symbol is never used DCMD
#1

hi guys i got a problem i made a command for /giveadmin but when i compile it, i get the error, why?.

Код:
dcmd_giveadmin(playerid, params[]) //error line
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[GIVEADMIN])
    {
        new string[128];
        format(string, sizeof(string), "You must be a level %d administrator to use that command!", gCommands[GIVEADMIN]);
        SendClientMessage(playerid, COLOR_ORANGE, string);
    }
    else
    {
        new tmp[256], tmp2[256], index, id;
        tmp = strtok(params, index);
        tmp2 = strtok(params, index);

        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_ORANGE, "[GIVEADMIN] Usage: /giveadmin [ID]");
        }
        else if(!strlen(tmp2))
        {
            SendClientMessage(playerid, COLOR_ORANGE, "[GIVEADMIN] Usage: /giveadmin [ID]");
        }
        else
        {
            id = strval(tmp);
            if(!IsPlayerConnected(id))
            {
                SendClientMessage(playerid, COLOR_ORANGE, "[GIVEADMIN] That player is not connected.");
            }
            else if(id == playerid)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "[GIVEADMIN] You are allready admin!.");
			}
            else
            {
                SendClientMessage(id, LIGHTBLUE, "Congratulations you have recieved admin!");
                dini_IntSet(file, "Level", 1);
            }
        }
    }
    return 1;
}
Reply
#2

Did you put

dcmd(giveadmin, 9, cmdtext);

in OnPlayerCommandText?
Reply
#3

No, i didnґt i got 2 errors but i fixed, thank you.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)