Warning for my command|
#1

Well, im making a /makeleader command, this is what it turned out to be right now:
pawn Код:
dcmd_makeleader(playerid, params[])
{
    new
        giveplayerid,
        factionid,
        string[128];
    if (sscanf(params, "ud", giveplayerid, factionid)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /makeleader [playerid/partname] [factionid]");
    else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
        if(PlayerInfo[playerid][AdminLevel] = 1337)
        {
            if(factionid <= 14)
            {
                PlayerInfo[giveplayerid][pMemberF] = factionid;
                format(string, sizeof(string), "An admin has set your faction to factionid %d.", PlayerInfo[playerid][pMemberF]);
                SendClientMessage(playerid, COLOR_GREEN, string);
            }
            else if(factionid >= 14)
            {
                SendClientMessage(playerid, COLOR_GREEN, "The Factionid needs to be between 14 and 0 !");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You are not authorized to use this command !");
        }
    }
    return 1;
}
The error i get is:
Код:
C:\Users\Administrator\Desktop\samp03csvr_R2-2_win32 (10)\gamemodes\KTS.pwn(394) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warnings.
Sorry if its obvious why its not working, or if there is something majorly wrong, its just that im new to scripting.

Thanks for any help,
/DaRealz\
Reply
#2

pawn Код:
if(PlayerInfo[playerid][AdminLevel] = 1337)
should be:

pawn Код:
if(PlayerInfo[playerid][AdminLevel] == 1337)
You just missed one '='.

PS: Next time please mark the line where the error is, then it is easier to find it. ^^

Jeffry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)