Admin
#2

You have some missing brackets in that snippet firstly and secondly you have an unused parameter in your IsAdminConnected function, so you need to remove that unless you're going to use it!

pawn Код:
public weaponanti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (GetPlayerWeapon(i) == 38)
        {
            if(!AdminConnected()) Ban(i);
            else
            {
                new pname[200];
                new string[200];
                new ammo = GetPlayerAmmo(i);
                new plrIP[16];
                GetPlayerIp(i, plrIP, sizeof(plrIP));
                GetPlayerName(i, pname, sizeof(pname));
                format(string,sizeof(string),"%s [ID: %d] [IP:%s] is suspected of having Minigun Hacks (Ammo: %i) [Use /getinfo %d]",pname,i,plrIP,ammo,i);
                CallRemoteFunction("SendClientMessageToAdmins","isi",0xFF0000,string,1);
                format(string,sizeof(string),"Alex has a minigun");
                SetTimer("banningtimer",15000,0);
                banning[i] =1;
            }
        }
    }
    return 1;
}

stock AdminConnected()
{
    for(new a, g = GetMaxPlayers(); a < g; a++)
        if(IsPlayerConnected(a) && IsPlayerAdmin(a)) return 1;
    return 0;
}
There are other problems with your code too, like creating an array with a huge amount of wasted cells and the fact that this snippet of code could get called several times depending on the amount of times this callback is called.

Since you're struggling with such basic PAWN, I highly suggest you read the PAWN manuals over at CompuPhase's website.
Reply


Messages In This Thread
Admin - by Alex_Obando - 29.08.2011, 00:31
Re: Admin - by JaTochNietDan - 29.08.2011, 00:59
Respuesta: Admin - by Alex_Obando - 29.08.2011, 01:02
Re: Admin - by LetsOWN[PL] - 29.08.2011, 01:07
Respuesta: Admin - by kirk - 29.08.2011, 01:07
Re: Respuesta: Admin - by JaTochNietDan - 29.08.2011, 01:08
Respuesta: Re: Respuesta: Admin - by kirk - 29.08.2011, 01:10
Re: Admin - by LetsOWN[PL] - 29.08.2011, 01:11
Re: Admin - by JaTochNietDan - 29.08.2011, 01:13
Re: Admin - by LetsOWN[PL] - 29.08.2011, 01:15

Forum Jump:


Users browsing this thread: 1 Guest(s)