27.10.2013, 13:32
Here you go, I also indent your code, because the indentation wasn't that good, also make sure on your BanPlayer stock or callback you have something like this
Lines from 508 to 573
Lines from 1136 to 1144
pawn Код:
//If stock
stock BanPlayer(playerid, reason[], adminame[])
//if callback
forward BanPlayer(playerid, reason[], adminame[]);
public BanPlayer(playerid, reason[], adminame[])
pawn Код:
function OnServerUpdate()
{
new Float:armor, GetPlayerArmour(i, armor);
foreach(Player, i)
{
if(GetPlayerMoney(i) >= 1)
return ResetPlayerMoney(i);
SetPlayerScore( i, pInfo[i][pXP] );
UpdateXPTextdraw( i );
if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
return BanPlayer(i, "Jetpack Hack", "Anti-Cheat");
if(armor >= 96)
return BanPlayer(i, "Armour Hack", "Anti-Cheat");
if(team[i] == TEAM_ZOMBIE && armor > 0.0))
return SetPlayerArmour(i, 0.0);
if(IsPlayerInAnyVehicle(i) && pInfo[i][pAdminLevel] == 0))
return Kick(i);
if(team[i] == TEAM_ZOMBIE)
{
switch(GetPlayerWeapon(i))
{
case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46:
{
ResetPlayerWeapons(i);
GivePlayerWeapon(i, 9, 1);
}
}
}
if(pInfo[i][pVipFlash] == 1)
{
switch(random(2))
{
case 0: SetPlayerColor(i,COLOR_YELLOW);
case 1: SetPlayerColor(i,COLOR_RED);
}
}
DoctorShield();
UpdateAliveInfo();
}
return 1;
}
pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
if(!PlayerShotPlayer[killerid][playerid])
return BanPlayer(playerid, "Fake Killng", "Anti-Cheat");
}