10.08.2011, 09:59
I trying to make a weapon anticheat but i have a little problem....
If I use the new fuction to give someone a weapon it also give me a kick....
help please
this is my script:
plese a little help guys!
If I use the new fuction to give someone a weapon it also give me a kick....
help please
this is my script:
Код:
forward WeaponTimer();
public WeaponTimer()
{
new string[256], str1[256], str2[256], str3[256];
new username[MAX_PLAYER_NAME];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
for(new w = 0; w < 13; w++)
{
new tweap, tammo;
GetPlayerWeaponData(i, w ,tweap ,tammo);
format(str1,sizeof(str1),"wslot%d",w);
format(str2,sizeof(str2),"weap%d",tweap);
if(GetPVarInt(i,str1) != tweap)
{
GetPlayerName(i,username,sizeof(username));
format(string, 256, "AdmWarning: [%d]%s just try to spawn a weapon",i,username);
ABroadCast(COLOR_LIGHTRED,string,1);
Kick(i);
}
}
}
}
}
Код:
stock YAN_GiveWeapon(playerid,weapon,ammo)
{
new str[10];
format(str,sizeof(str),"weap%d",weapon);
SetPVarInt(playerid,str,1);
format(str,sizeof(str),"wslot%d",GetWeaponSlot(weapon));
SetPVarInt(playerid,str,weapon);
GivePlayerWeapon(playerid,weapon,ammo);
}


