09.08.2012, 16:43
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
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;
}