Jump to content
  • 0

Unlocking keyed vehicles when no key exists


Havoc302

Question

So I've been looking through the SQL scripts to unlock a vehicle if there's no keys on any players, does anyone know of one that checks for the key in other vehicles, safes, storage sheds and on players? Basically anywhere in the Object_data or character_data tables before it goes unlocking them?

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Find Vehicle Function - FindVehicleKeysCount:

BEGIN





DECLARE totalKeys INT DEFAULT 0;



DECLARE keyName VARCHAR(32) DEFAULT "";



DECLARE keysInChar INT DEFAULT 0;



DECLARE keysInObj INT DEFAULT 0;



SET keyName = (CASE



WHEN `keyId` < 2501 THEN CONCAT('ItemKeyGreen', `keyId`)



WHEN `keyId` < 5001 THEN CONCAT('ItemKeyRed', `keyId` - 2500)



WHEN `keyId` < 7501 THEN CONCAT('ItemKeyBlue', `keyId` - 5000)



WHEN `keyId` < 10001 THEN CONCAT('ItemKeyYellow', `keyId` - 7500)



WHEN `keyId` < 12501 THEN CONCAT('ItemKeyBlack', `keyId` - 10000)



ELSE 'ERROR'



END);



SET keysInChar = (SELECT COUNT(*) FROM `Character_DATA` WHERE `Alive` = '1' AND (`Inventory` LIKE CONCAT('%', keyName, '%') OR `Backpack` LIKE CONCAT('%', keyName, '%')));



SET keysInObj = (SELECT COUNT(*) FROM `Object_DATA` WHERE `Inventory` LIKE CONCAT('%', keyName, '%'));



RETURN (keysInChar + keysInObj);



END

 

Delete Function - DeleteNonKeyVehicles (I changed it to unlock instead of delete:

BEGIN





UPDATE `object_data`



SET `CharacterID` = 0



WHERE



`object_data`.`CharacterID` <> 0



AND `Object_DATA`.`CharacterID` <= 12500



AND `Object_DATA`.`Classname` NOT LIKE 'Tent%'



AND `Object_DATA`.`Classname` NOT LIKE '%Locked'



AND `Object_DATA`.`Classname` NOT LIKE 'Land%'



AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%'



AND `Object_DATA`.`Classname` NOT LIKE 'Wood%'



AND `Object_DATA`.`Classname` NOT LIKE 'Metal%'



AND `Object_DATA`.`Classname` NOT LIKE '%Storage%'



AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ')



AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0;



RETURN ROW_COUNT();



END

 

SQL Query to run:

SELECT DeleteNonKeyVehicles();
Link to comment
Share on other sites

  • 0

Lol wow, you sell vehicles on your server.. i thought dami was the only one in aus to do that

http://customcombatgaming.com/forums/index.php?/store/category/13-base-vehicles/- And they sell a hell of a lot more. They've also been the most popular servers in Australia for about a year.

 

http://www.zrclan.com/donatorperks- Second largest gaming community in Australia, no vehicles but there's everything else.

 

http://www.themotoclan.com/vip#builders-kits-822864Number one Epoch server on the planet according to Gametracker stats.

 

http://www.de-1000.de/viewforum.php?f=4&sid=3903035814925a074db338136368af27- Number two Epoch server on the planet according to Gametracker stats. 

 

I could go on all day with this. Ultimately, like everyone else, the money only pays for the server. We limit it to naturally acquired vehicles too, so there's no difference between them going to the traders ingame and buying them or us delivering them. Debate it all you like. This thread wasn't about that.

Link to comment
Share on other sites

  • 0

Why wouldn't you have a vehicle trader? I've got 4 different vehicle traders on my servers. They include civilian vehicle unarmed and armed and military vehicles armed and unarmed. Different humanity requirements to buy and sell to each of them except the civilian unarmed vehicles.

 

Someone help this guy out, he's completely lost :D

Link to comment
Share on other sites

  • 0

Why wouldn't you have a vehicle trader? I've got 4 different vehicle traders on my servers. They include civilian vehicle unarmed and armed and military vehicles armed and unarmed. Different humanity requirements to buy and sell to each of them except the civilian unarmed vehicles.

 

For money, real life money :P not briefcases and gold :lol:

 

4Zkp7KE.png

Link to comment
Share on other sites

  • 0

For money, real life money :P not briefcases and gold :lol:

 

Oh, There's no post in this thread where anyone said they were selling vehicles on websites when Buck0 said "Lol wow, you sell vehicles on your server.. i thought dami was the only one in aus to do that". Therefore I figured that having vehicle traders was something strange to him.

Link to comment
Share on other sites

  • 0

Hi

I have a problem. I have bought a truck and unfortunatly left the keys inside. After server's restart the car become locked, while they key was still inside it. I have a lot of stuff in that, and i would like to get it back. Is it any way to do it?

Thanks for help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...