Warning EDIT: write mistake xD
#1

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
Reply
#2

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)
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)