SA-MP Forums Archive
Warning EDIT: write mistake xD - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning EDIT: write mistake xD (/showthread.php?tid=186314)



Warning EDIT: write mistake xD - Hornet600 - 28.10.2010

someone could help me and explain what i did wrong with this code? Thanks for all replys
pawn Код:
forward ShowStats(playerid,targetid);
public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        if(PlayerLogged[playerid] = 1) // something is wrong but i cant find out wich is.. lol
        {
            new name[MAX_PLAYER_NAME];
            GetPlayerName(targetid, name, sizeof(name));
            new coordsstring[128];
            format(coordsstring, sizeof(coordsstring),"|_________________| %s  |_____________________",name);
            SendClientMessage(playerid, COLOR_RED,coordsstring);
            format(coordsstring, sizeof(coordsstring),"[Score]:%d   [Money]:%d  ",GetPlayerScore(playerid), GetPlayerMoney(playerid));
            SendClientMessage(playerid, COLOR_RED,coordsstring);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "[SYSTEM] Login before use any command");
    }
    return 1;
}
Код:
68) : warning 211: possibly unintended assignment



Re: Warning EDIT: write mistake xD - DeathOnaStick - 28.10.2010

Quote:
Originally Posted by Hornet600
Посмотреть сообщение
someone could help me and explain what i did wrong with this code? Thanks for all replys
pawn Код:
forward ShowStats(playerid,targetid);
public ShowStats(playerid,targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        if(PlayerLogged[playerid] = 1) // something is wrong but i cant find out wich is.. lol
        {
            new name[MAX_PLAYER_NAME];
            GetPlayerName(targetid, name, sizeof(name));
            new coordsstring[128];
            format(coordsstring, sizeof(coordsstring),"|_________________| %s  |_____________________",name);
            SendClientMessage(playerid, COLOR_RED,coordsstring);
            format(coordsstring, sizeof(coordsstring),"[Score]:%d   [Money]:%d  ",GetPlayerScore(playerid), GetPlayerMoney(playerid));
            SendClientMessage(playerid, COLOR_RED,coordsstring);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "[SYSTEM] Login before use any command");
    }
    return 1;
}
Код:
68) : warning 211: possibly unintended assignment
'=' in If-Statements always need to be double. So replace
pawn Код:
if(PlayerLogged[playerid] = 1)
with
pawn Код:
if(PlayerLogged[playerid] == 1)



Re: Warning EDIT: write mistake xD - Hornet600 - 28.10.2010

-oh ye thanks man next time i will check it before ask