Error: Unknown command
#1

My /adminize command, when i just do /adminize it says USAGE:.... but when I fill it it (ex: /adminize 1 5) it says Unknown Command! Help please.

pawn Код:
if(!strcmp(cmdtext[1],"adminize",true))
{
    if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_YELLOW, "[!] USAGE: /adminize [playerid] [admin level]");
    return 1;
}
    new para1;
    new level;
    if(IsStringAName(tmp))
{
    para1 = GetPlayerID(tmp);
}
    else
{
    para1 = strval(tmp);
}
    level = strval(tmp);
    new playa = strval(tmp);
    if(pAdmin[playerid] >= 5)
{
    if(logged[playerid] == 1)
{
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    pAdmin[para1] = level;
    format(string, sizeof(string), "[!] Admin %s has promoted you to a level %s admin!",sendername, result); //LINE 360 !!
    SendClientMessage(playa, COLOR_GREEN, string);
    format(string, sizeof(string), "[!] You have promoted %s to a level %s admin!",giveplayer, result);
    SendClientMessage(playerid, COLOR_GREEN, string);
}
}
    else
{
    SendClientMessage(playerid, COLOR_RED, "[!] You cannot use this command!");
}
    return 1;
}
Reply
#2

You're using strtok (I'm assuming) incorrectly. You need to set a variable to the splitted parameter (strtok, fscan, and split I consider 'splitters'). The split function has to be used for each parameter.
Reply
#3

explain?
Reply
#4

https://sampwiki.blast.hk/wiki/Strtok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)