GhostTown Posted February 10, 2014 Report Share Posted February 10, 2014 I saw a few servers have this and was wondering how its done or is it just custom to there server? Its like 4am for me so Im to tired to check through all the epoch files incase its already included. Abandoned safes now opened after 10 days Abandoned owned vehicles (locked) that haven't been used in 2 days are now auto unlocked Sorry if this is in the wrong section. Link to comment Share on other sites More sharing options...
0 MGT Posted February 10, 2014 Report Share Posted February 10, 2014 It's an SQL function, check my posts. Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 I cant seem to find them? Sorry im half asleep. I have cookies tho? Link to comment Share on other sites More sharing options...
0 Sukkaed Posted February 10, 2014 Report Share Posted February 10, 2014 UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 2 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 2 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage','LockboxStorage','VaultStorageLocked','LockboxStorageLocked','WoodShack_DZ','StorageShed_DZ','TentStorageDomed','TentStorageDomed2','TentStorage') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 Awesome! Thanks for the fast replies. Now me sleep lol I understand the first one. That unlocks everything besides those classnames? But the second I dont understand? Unless im just reading it wrong Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 10, 2014 Report Share Posted February 10, 2014 The second one needs a bit of tweaking...its to unlock Vaults, not used in 10 days....but the way it is it can 'catch' some vehicles as well... I am not sure if setting CharacterID to 0 unlocks vaults....maybe also set the classname to VaultStorage ?!? Anyways, a safer SQL would be: UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `CharacterID` > 0 AND `Classname` IN ('VaultStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL This will make sure only Vaults are affected. But testing is required to see if vaults are actually unlocked ingame when setting CharacterID to 0 Link to comment Share on other sites More sharing options...
0 MGT Posted February 10, 2014 Report Share Posted February 10, 2014 It sets code to 0000 Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 10, 2014 Report Share Posted February 10, 2014 It sets code to 0000 Still a normal player not following this forum would not know that....Wouldnt setting the vault to VaultStorage, spawn it unlocked on server restart ? Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 I understand that part.. But what I got confused on was NOT IN ('VaultStorage') ? So how would that set it to 0 when he is using the NOT IN Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 10, 2014 Report Share Posted February 10, 2014 I understand that part.. But what I got confused on was NOT IN ('VaultStorage') ? So how would that set it to 0 when he is using the NOT IN VaultStorage locked are the ones you want. Thats why i did: `Classname` IN ('VaultStorageLocked') Run this and see...it will bring all the locked vaults: SELECT * FROM `object_data` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `CharacterID` > 0 AND `Classname` IN ('VaultStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 Thank you that makes sense to me now. :) Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 So these are functions correct? Is there any way to turn them into events and have them run on there own? Im still new to creating SQLs and stuff for the Database Snobby 1 Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 10, 2014 Report Share Posted February 10, 2014 So these are functions correct? Is there any way to turn them into events and have them run on there own? Im still new to creating SQLs and stuff for the Database Turning into an event it easy....I use PHPMyadmin to handle my database... Just create a new event, select the time interval (once a day for example, starting from now (16:55:00 10/2/14) and then 'what' to execute, i copy paste the SQL function). With other tools, i got no idea....google your tools' name and the word event : Navicat event (for example) Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 10, 2014 Author Report Share Posted February 10, 2014 Lul sometimes I laugh at my self. I know how to create events and stuff.. But when I tried it it gave me errors. Went and took a break came back and it worked -_- Link to comment Share on other sites More sharing options...
0 Sukkaed Posted February 11, 2014 Report Share Posted February 11, 2014 Yes, that sets the safe code to 0000. You can't unlock them as every "VaultStorage" is swapped to "VaultStorageLocked" on server restart. I guess you could change all "VaultStorageLocked" with character ID 0 to "VaultStorage" and run it right after every restart. Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 11, 2014 Report Share Posted February 11, 2014 If you want you can do this little trick in your fn_selfactions.sqf to notify players when the safe is an Abandoned safe: _ownerID = _cursorTarget getVariable ["CharacterID","0"]; // It should be further up in the .sqf file...but i added it here for reference if((typeOf(cursortarget) == "VaultStorageLocked") and _ownerID == "0000" and (player distance _cursorTarget < 2)) then { cutText [format["Abandoned safe, code is 0000"], "PLAIN DOWN"]; }; :P Cannon and oSoDirty 2 Link to comment Share on other sites More sharing options...
0 GhostTown Posted February 11, 2014 Author Report Share Posted February 11, 2014 Awesome thank you Sandbird! Are you able to upload a copy of your fn_selfactions so I can see exactly where you placed this? I am still waiting for 1.0.4.2 before I do anymore updates! :) Link to comment Share on other sites More sharing options...
0 Sandbird Posted February 11, 2014 Report Share Posted February 11, 2014 If you have : if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < _allowedDistance) and _canDo) then { //Has some kind of target Then add it right before the } else { at the bottom of this if. I got mine right above: / Allow Owner to lock and unlock vehicle But i dont use mine to see vault safes...I use it to see Plot IDs, so i can find easily in the database who owns that plot pole... //At the top of my fn_selfactions _adminlist = call compile preProcessFileLineNumbers "superadmins.sqf"; // superadmin.sqf is in my root mission folder and has inside: ["xxxxxxx","xxxxxxx","xxxxxxx","xxxxxxx","xxxxxxx"]; // admin UIDs ..... ..... if((typeOf(cursortarget) == "Plastic_Pole_EP1_DZ") and _ownerID != "0" and (player distance _cursorTarget < 2)) then { if ((getPlayerUID player) in _adminlist) then { cutText [format["Plot Pole Owner PUID is: %1",_ownerID], "PLAIN DOWN"]; }; }; Link to comment Share on other sites More sharing options...
0 Draftkid Posted March 17, 2014 Report Share Posted March 17, 2014 VaultStorage locked are the ones you want. Thats why i did: `Classname` IN ('VaultStorageLocked') Run this and see...it will bring all the locked vaults: SELECT * FROM `object_data` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) AND `CharacterID` > 0 AND `Classname` IN ('VaultStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL I'm very interested in this, I've added this to my events in my SQL and set it to run once per day but i have not seen any safes change codes to 0... i wondering if I'm missing something. Link to comment Share on other sites More sharing options...
0 Dave Posted March 17, 2014 Report Share Posted March 17, 2014 isn't that only the "Select" and not the "Update" ? So it isn't going to change anything. Link to comment Share on other sites More sharing options...
0 Draftkid Posted March 18, 2014 Report Share Posted March 18, 2014 k got it Link to comment Share on other sites More sharing options...
0 Draftkid Posted March 18, 2014 Report Share Posted March 18, 2014 OK. So i did not have the last updated column.... im a dumb ass lol add it in by running ALTER TABLE `Object_DATA` ADD `LastUpdated` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `Datestamp`; and use MR MGT's code UPDATE `object_data` SET `CharacterID` = 0 WHERE `lastactive` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL only thing i changed was the lastactive to LastUpdated and then.. pure sexyness (if that's a word O.o ) in the sql data base Link to comment Share on other sites More sharing options...
0 Dismal Posted May 24, 2014 Report Share Posted May 24, 2014 The addition to fn_selfaction to allow me to show players that the safe is abandoned is not working for me. Has this changed since 1.4.0.2a? is it possible to get a clearer tutorial on how to install the addition? Link to comment Share on other sites More sharing options...
0 d0t Posted May 25, 2014 Report Share Posted May 25, 2014 Anyone have a sollution? I also dont get the message working by editing the fn_selfaction Link to comment Share on other sites More sharing options...
0 Vanguard Posted June 11, 2014 Report Share Posted June 11, 2014 If you have : if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < _allowedDistance) and _canDo) then { //Has some kind of target Then add it right before the } else { at the bottom of this if. I got mine right above: / Allow Owner to lock and unlock vehicle But i dont use mine to see vault safes...I use it to see Plot IDs, so i can find easily in the database who owns that plot pole... //At the top of my fn_selfactions _adminlist = call compile preProcessFileLineNumbers "superadmins.sqf"; // superadmin.sqf is in my root mission folder and has inside: ["xxxxxxx","xxxxxxx","xxxxxxx","xxxxxxx","xxxxxxx"]; // admin UIDs ..... ..... if((typeOf(cursortarget) == "Plastic_Pole_EP1_DZ") and _ownerID != "0" and (player distance _cursorTarget < 2)) then { if ((getPlayerUID player) in _adminlist) then { cutText [format["Plot Pole Owner PUID is: %1",_ownerID], "PLAIN DOWN"]; }; }; Not to sound as a multinoob, (Which i am) How would i go about to add this wonderful piece of code? Looks really useful, when players try to scam admins into helping them with "their" base XD Link to comment Share on other sites More sharing options...
Question
GhostTown
I saw a few servers have this and was wondering how its done or is it just custom to there server?
Its like 4am for me so Im to tired to check through all the epoch files incase its already included.
Abandoned safes now opened after 10 days
Abandoned owned vehicles (locked) that haven't been used in 2 days are now auto unlocked
Sorry if this is in the wrong section.
Link to comment
Share on other sites
24 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now