19.01.2012, 16:25
that won't work unless you are ID 0
You need a loop to check through all players..
try this:
You need a loop to check through all players..
try this:
pawn Код:
public WeaponCheck()
{
new IP[16];
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(!IsPlayerConnected(playerid)) return 0;
if( PlayerInfo[playerid][pAdmin] >=1 ) return 0;
if( WeaponGiven[playerid] == 1 ) return 0;
if( Logged[playerid] == 1 )
{
new weaponid = GetPlayerWeapon( playerid );
if( ( weaponid >= 1 && weaponid <=45 ) )
{
GetPlayerName( playerid, Nam, sizeof Nam );
GetPlayerIp( playerid, IP, 16 );
format( mystring, sizeof mystring, "Admin-Log: %s has been banned for weapon hack(%s).", Nam, IP);
SendAdminMessage( COLOR_RED, mystring );
BanEx(playerid, "WEAPON HACK");
}
}
}
return 1;
}