Random Error
#3

its not the afk command causing this , im pretty sure but here you go :
pawn Код:
CMD:afk(playerid,params[])
{
    if(IsAfk[playerid] == 0)
    {
        new string[128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,sizeof(pName));
        format(string,sizeof(string),"%s(%d) is now AFK -%s",pName,playerid,params);
        TogglePlayerControllable(playerid,0);
        SendClientMessageToAll(COLOR_YELLOW,string);
        IsAfk[playerid] = 1;
        }
        else
        SendClientMessage(playerid,COLOR_BRIGHTRED,"You are already AFK");
    return true;
}
Before CMD:afk :
pawn Код:
forward SendClientMessageToAllCops(msg[]);
public SendClientMessageToAllCops(msg[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(HasLawEnforcementRadio[i] == 1)
            {
                SendClientMessage(i,COLOR_LIGHTBLUE,msg);
            }
        }
    }
EDIT: I figured it out :S .
It should be
pawn Код:
forward SendClientMessageToAllCops(msg[]);
public SendClientMessageToAllCops(msg[])
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(HasLawEnforcementRadio[i] == 1)
            {
                SendClientMessage(i,COLOR_LIGHTBLUE,msg);
            }
        }
    }
        return 1;
}
Sorry...
Reply


Messages In This Thread
Random Error - by Johnson_Brooks - 15.05.2014, 20:38
Re: Random Error - by Sasino97 - 15.05.2014, 20:40
Re: Random Error - by Johnson_Brooks - 15.05.2014, 20:44
Re: Random Error - by Sasino97 - 15.05.2014, 20:52
Re: Random Error - by Johnson_Brooks - 15.05.2014, 21:37

Forum Jump:


Users browsing this thread: 1 Guest(s)