SSCANF issues 0.3D
#7

pawn Код:
CMD:setadmin(playerid,params[])
{
    new id,level,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME],string[128];
    if(PlayerInfo[playerid][pAdmin] < 10) return 1;
    if (sscanf(params,"ud",id,level)) return SendClientMessage(playerid,COLOR_RED,"Usage:/setadmin [ID] [Admin Level]");
    if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
    PlayerInfo[id][pAdmin] = level;//Here you had playerid instead of id
    GetPlayerName(playerid,n,sizeof(n));
    GetPlayerName(id,on,sizeof(on));
    format(string,sizeof(string),"Your Admin Level Has Been Set To %d By %s ",level,n);
    SendClientMessage(id,COLOR_ORANGE,string);
    format(string, sizeof(string), "You have set %s Admin Level To %d",on,level);
    SendClientMessage(playerid,COLOR_ORANGE,string);
    //you had one additional Level setting here :S
    return 1;
}
Read comments
Reply


Messages In This Thread
SSCANF issues 0.3D - by Shockey HD - 19.12.2011, 05:59
Re: SSCANF issues 0.3D - by [MG]Dimi - 19.12.2011, 06:02
Re: SSCANF issues 0.3D - by Shockey HD - 19.12.2011, 06:02
Re: SSCANF issues 0.3D - by Calgon - 19.12.2011, 06:03
Re: SSCANF issues 0.3D - by Shockey HD - 19.12.2011, 06:05
Re: SSCANF issues 0.3D - by Calgon - 19.12.2011, 06:07
Re: SSCANF issues 0.3D - by [MG]Dimi - 19.12.2011, 06:08
Re: SSCANF issues 0.3D - by Shockey HD - 19.12.2011, 06:15

Forum Jump:


Users browsing this thread: 3 Guest(s)