command wont work properly and strcmp [ need help ]
#1

guys i have a problem with my command
i cop the strcmp from my login system that work
but why when it is in my command
it will go haywire
i need explination

btw here is my code mind if you can fix it

pawn Код:
CMD:giveadmin(playerid,params[])
{
    new id, rank[28];
    if(sscanf(params,"us[28]",id,rank)) return SendClientMessage(playerid,C_RED,"[ Sytax ]:"CWHITE" /giveadmin [ id ] ["CMOD" Moderator "CWHITE"/"CADMIN" Administrator"CWHITE" /"COWNER" Owner"CWHITE" ] ");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,C_RED,"[ Error ]:"CWHITE" Player Unknown / Not Connected ");
    if(pData[playerid][pAdmin] < 3|| !IsPlayerAdmin(playerid)) return CMD_ERROR
    if(!strcmp(rank,"moderator"))
    {
        pData[id][pAdmin] = 1;
    }
    else if(!strcmp(rank,"mod"))
    {
        pData[id][pAdmin] = 1;
    }
    else if(!strcmp(rank,"administrator"))
    {
        pData[id][pAdmin] = 2;
    }
    else if(!strcmp(rank,"admin"))
    {
        pData[id][pAdmin] = 2;
    }
    else if(!strcmp(rank,"owner"))
    {
        pData[id][pAdmin] = 3;
    }
    else return SendClientMessage(playerid,C_RED,"[ Sytax ]:"CWHITE" /giveadmin [ id ] ["CMOD" Moderator "CWHITE"/"CADMIN" Administrator"CWHITE" /"COWNER" Owner"CWHITE" ] ");
    new string[500];
    format(string,sizeof(string),"%s %s has given you a %s status",a_rank_names(playerid),PlayerRPName(playerid),a_rank_names(id));
    SendClientMessage(playerid,C_WHITE,string);
    return 1;
}
Reply


Messages In This Thread
command wont work properly and strcmp [ need help ] - by RicaNiel - 09.08.2012, 16:43
Re: command wont work properly and strcmp [ need help ] - by Dawnz - 09.08.2012, 16:50
Re: command wont work properly and strcmp [ need help ] - by RicaNiel - 09.08.2012, 16:54
Re: command wont work properly and strcmp [ need help ] - by Dawnz - 09.08.2012, 17:00
Re: command wont work properly and strcmp [ need help ] - by Vince - 09.08.2012, 17:00

Forum Jump:


Users browsing this thread: 1 Guest(s)