03.06.2010, 21:29
So we set a variable PlayerInfo[i][pHasGun] and whenever the player buys a gun this variable turns into 1.
GetPlayerWeaponData(i, w, weapon, ammo);
if(weapon >= 1 && weapon <= 46 && PlayerInfo[i][pHasGun] == 0)//gun check if the player has a gun which id is higher than 0 and lower or equal to 46 which was not bought ingame then it would reset player weapons, else it won't
{
ResetPlayerWeapons(i);
{
format(string, sizeof(string), "AdmCmd: %s Tried to hack and his/her guns have got resetted", PlayerName(i));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}
I tested this and it worked, but hackers may still find their way through.
Known Issues: The player may buy a mp5 and then he will start hacking weapons all around
We can also set a method so the player gets a gun with a quantity of ammo of 8000 for example and if the ammo is lower than 5000 we can strip the weapons away.
GetPlayerWeaponData(i, w, weapon, ammo);
if(weapon >= 1 && weapon <= 46 && PlayerInfo[i][pHasGun] == 0)//gun check if the player has a gun which id is higher than 0 and lower or equal to 46 which was not bought ingame then it would reset player weapons, else it won't
{
ResetPlayerWeapons(i);
{
format(string, sizeof(string), "AdmCmd: %s Tried to hack and his/her guns have got resetted", PlayerName(i));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
}
I tested this and it worked, but hackers may still find their way through.
Known Issues: The player may buy a mp5 and then he will start hacking weapons all around
We can also set a method so the player gets a gun with a quantity of ammo of 8000 for example and if the ammo is lower than 5000 we can strip the weapons away.