Weapon saving
#2

Hey, nice to see someone actually normalizing their tables, however I suggest adding a 4th column in your table called slot, make it unique (and un-unique the weaponid if it is) then you can use the 'INSERT INTO ... ON DUPLICATE ..) for same slots
here is a function to know which slot each weapon belongs (credits to Hiddos)
PHP код:
GetWeaponSlot(weaponid)
{
new 
slot;
switch(
weaponid)
{
case 
0,1slot 0;
case 
.. 9slot 1;
case 
10 .. 15slot 10;
case 
16 .. 1839slot 8;
case 
22 .. 24slot =2;
case 
25 .. 27slot 3;
case 
282932slot 4;
case 
3031slot 5;
case 
3334slot 6;
case 
35 .. 38slot 7;
case 
40slot 12;
case 
41 .. 43slot 9;
case 
44 .. 46slot 11;
}
return 
slot;

Reply


Messages In This Thread
Weapon saving - by vernz - 08.05.2016, 06:53
Re: Weapon saving - by PrO.GameR - 08.05.2016, 10:07
Re: Weapon saving - by vernz - 08.05.2016, 14:37
Re: Weapon saving - by PrO.GameR - 08.05.2016, 14:43
Re: Weapon saving - by vernz - 08.05.2016, 14:48
Re: Weapon saving - by vernz - 08.05.2016, 14:52
Re: Weapon saving - by PrO.GameR - 08.05.2016, 19:48
Re: Weapon saving - by vernz - 08.05.2016, 20:40

Forum Jump:


Users browsing this thread: 1 Guest(s)