26.11.2013, 09:50
Make a variable to store the players weapon in for example. PlayerInfo[playerid][pMeele].
Your code will be like this for the anticheat (Not full code)
Giving a weapon will then be like this.
There are alot of ways to do this but I am in college and gave one of the simplest ways I know, I will post here again if your still having trouble after college.
Your code will be like this for the anticheat (Not full code)
pawn Код:
public weaponanti()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (GetPlayerWeapon(i) == 1 && PlayerInfo[i][pMeele] != 1)
{
new pname[200];
new string[200];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "[ANTI-CHEAT] %s Banned for Weapon Hack", pname);
SendClientMessageToAll(COLOR_GREEN,string);
SetTimer("banningtimer",2000,0);
banning[i] =1;
}
}
pawn Код:
PlayerInfo[playerid][pMeele] = 1;//Meele Weapon id here.
GivePlayerWeapon(playerid, 1,1);