14.12.2013, 16:39
Hello, so I was writing an anti weapon cheat...
This is pretty much it.. I hooked the GivePlayerWeapon function for it to add the weapon to "RealPlayerWeapons" array.
It all seems to work fine with miniguns and stuff. But once I cheat myself a weapon like "Nightstick" or a dildo of some sort, it just doesn't remove it.
After I cheated it, I looked trought the array and it wasn't there. So why doesn't it remove it?
pawn Код:
new weaponid = GetPlayerWeapon(playerid);
if(weaponid != 0)
{
new bool:found = false;
for(new i; i < sizeof(RealPlayerWeapons[]); i++)
{
if(weaponid == RealPlayerWeapons[playerid][i][0])
{
found = true;
RealPlayerWeapons[playerid][i][1] = GetPlayerAmmo(playerid);
}
}
if(!found) RemovePlayerWeapon(playerid,weaponid);
}
It all seems to work fine with miniguns and stuff. But once I cheat myself a weapon like "Nightstick" or a dildo of some sort, it just doesn't remove it.
After I cheated it, I looked trought the array and it wasn't there. So why doesn't it remove it?