14.10.2016, 11:29
PHP код:
//Top of your script
new bool:Weapon[MAX_PLAYERS][47];
//OnPlayerDisconnect/Connect
for(new i; i < 46; i++) Weapon[playerid][i] = false;
//Somewhere in your script
GivePlayerWeaponEx(playerid, weaponid, ammo)
{
Weapon[playerid][weaponid] = true;
return GivePlayerWeapon(playerid,weaponid,ammo);
}
ResetPlayerWeaponsEx(playerid)
{
for(new i; i < 46; i++) Weapon[playerid][i] = false;
return ResetPlayerWeapons(playerid);
}
//Make timer to check whether the player is hacking or not
new weaponid, ammo;
for (new x = 0; x <= 12; x++)
{
GetPlayerWeaponData(playerid, x, weaponid, ammo);
if(weaponid > 0 && weaponid != 46 && Weapon[playerid][weaponid] == false)
{
ResetPlayerWeapons(playerid)
return Kick(playerid);
}
}
Don't forgot to change all the GivePlayerWeapon/ResetPlayerWeapons to GivePlayerWeaponEx/ResetPlayerWeaponsEx.

