SA-MP Forums Archive
symbol is never used DCMD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: symbol is never used DCMD (/showthread.php?tid=313946)



symbol is never used DCMD - ttloko2 - 28.01.2012

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;
}



Re: symbol is never used DCMD - MP2 - 28.01.2012

Did you put

dcmd(giveadmin, 9, cmdtext);

in OnPlayerCommandText?


Re: symbol is never used DCMD - ttloko2 - 28.01.2012

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