05.10.2010, 19:19
Hello,
I am making a suitcase system so that you can store guns in your suitcase...then you can /drop suitcase (create pickup of the suitcase) or /give suitcase [playerid] and anything else i can think of... I am thinking that the best way to do this is first of all making a new table for "suitcases" and each suitcase gets stored in there... i would use these fields:
Now, the ID will be the primary key, and its always important to have this so that it doesnt get repeated...although i will ALSO use a suitcase ID, although this will not be primary...Instead i will script it so when you "buy" a suitcase, it will make a new record and it will generate a new 6 digit ID and give this record that ID, but it will check through the DB first, and if it already exsists, it will get another random number.... This will not be Primary key for the table because the primary key is goin to be auto Incremented (AutoNumber)..
Now, the slot1, slot2, will just be either GunSlot1, GunSlot2 etc... or GunMaterials1, Drugs1....etc, i can add these as my server progresses...
The last thing i need to do is add a field to the accounts table caled... "suitcaseID", this will be the 6 digit number of the case you are holding, so you know which one is yours...
---
thats pretty much whole thing, i might of missed a few points out /...but overall, does this seem like a smart system?? here are a few more points:
() Will be sure that if a case has been dropped as a pickup and is not picked up by the time the server restarts or something, the script (under OnGameModeExit) will reconize this and wipe the record...
() Maybe a Owner field in the table for the suitcase... Dont really think that i need it, but might need it?
I am making a suitcase system so that you can store guns in your suitcase...then you can /drop suitcase (create pickup of the suitcase) or /give suitcase [playerid] and anything else i can think of... I am thinking that the best way to do this is first of all making a new table for "suitcases" and each suitcase gets stored in there... i would use these fields:
Код:
ID (primary Key, protocol) - Suitcase ID (6 digit number) - Slot1 - Slot2 - etc...
Now, the slot1, slot2, will just be either GunSlot1, GunSlot2 etc... or GunMaterials1, Drugs1....etc, i can add these as my server progresses...
The last thing i need to do is add a field to the accounts table caled... "suitcaseID", this will be the 6 digit number of the case you are holding, so you know which one is yours...
---
thats pretty much whole thing, i might of missed a few points out /...but overall, does this seem like a smart system?? here are a few more points:
() Will be sure that if a case has been dropped as a pickup and is not picked up by the time the server restarts or something, the script (under OnGameModeExit) will reconize this and wipe the record...
() Maybe a Owner field in the table for the suitcase... Dont really think that i need it, but might need it?