03.07.2012, 11:30
can u help me if i send you my script on pm
you'll see if i place something wrong
answer me please
you'll see if i place something wrong
answer me please
#define MAX_PLAYERS_TIMES_NUMBER(%0) MAX_PLAYERS * %0
#define WEAPON_SLOT_COUNT 13 //0 - 12
new Weapons[MAX_PLAYERS][WEAPON_SLOT_COUNT];
stock GetWeaponSlot(weaponid)
{
new slot;
switch(weaponid)
{
case 0,1: slot = 0;
case 2 .. 9: slot = 1;
case 10 .. 15: slot = 10;
case 16 .. 18, 39: slot = 8;
case 22 .. 24: slot = 2;
case 25 .. 27: slot = 3;
case 28, 29, 32: slot = 4;
case 30, 31: slot = 5;
case 33, 34: slot = 6;
case 35 .. 38: slot = 7;
case 40: slot = 12;
case 41 .. 43: slot = 9;
case 44 .. 46: slot = 11;
}
return slot;
}
//https://sampforum.blast.hk/showthread.php?pid=782197#pid782197
stock CheckWeapons(playerid)
{
new weaponid = GetPlayerWeapon(playerid);
new slot = GetWeaponSlot(weaponid);
if(Weapons[playerid][slot] != weaponid)
{
//not equal to the server's data
}
//don't even need to return anything
}
stock ServerWeapon(playerid, weaponid, ammo)
{
new slot = GetWeaponSlot(weaponid);
Weapons[playerid][slot] = weaponid;
GivePlayerWeapon(playerid, weaponid, ammo);
}