/a not working
#2

pawn Код:
if(!strcmp(cmd, "/a", true))
{
    if(pInfo[playerid][Admin] < 1) return 0;
    new text = cmdtext[4], adminname[24];
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /a [text]");
    GetPlayerName(playerid, adminname, sizeof(adminname));
    format(string,sizeof(string),"Adminchat (%s): %s", adminname, text);
    MessageToAdmins(purple,string);
    return 1;
}

stock MessageToAdmins(color,msg[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && pInfo[i][Admin] >= 1) SendClientMessage(i, color, string);
    }
    return 1;
}
This is how I would make it. Should work. Untested. Also your statements are saying if player's level is 0 or higher which means it includes 0. I guess the lowest your admin level is 1, not 0 so I changed script according to it. Also I think you can't make public callback for function. Use
pawn Код:
stock
Have fun. Post if any errors
Reply


Messages In This Thread
/a not working - by geerdinho8 - 05.01.2012, 15:42
Re: /a not working - by [MG]Dimi - 05.01.2012, 15:49
Re: /a not working - by geerdinho8 - 05.01.2012, 15:55
Re: /a not working - by [MG]Dimi - 05.01.2012, 15:56
Re: /a not working - by Jochemd - 05.01.2012, 15:58
Re: /a not working - by geerdinho8 - 05.01.2012, 16:00
Re: /a not working - by geerdinho8 - 05.01.2012, 16:06
Re: /a not working - by [MG]Dimi - 05.01.2012, 16:08
Re: /a not working - by geerdinho8 - 05.01.2012, 16:29
Re: /a not working - by Gh05t_ - 05.01.2012, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)