SA-MP Forums Archive
[HELP] invalid expression assumed zero - 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: [HELP] invalid expression assumed zero (/showthread.php?tid=487855)



[HELP] invalid expression assumed zero - Luca12 - 15.01.2014

I have that error on this line


pawn Код:
if(back == 0)

and know this is the all code:


pawn Код:
public OnPlayerEscapeDMZona(playerid,back)
{
    if(gPlayerLogged[playerid] != 1) return 1;
    if(back == 0)
    else
    {
        if(PlayerInfo[playerid][pDM] == 1)
        {
            SCM(playerid,ZUTA,"[OOC DM Zona] Vraceni ste nazad!Ukoliko zelite napustiti OOC DM Zonu koristi /dmexit!");
            SetPlayerPos_H(playerid,424.3157,2536.3532,15.6639);
            DMBjezanje[playerid] = 0;
        }
        if(PlayerInfo[playerid][pDM] == 2)
        {
            SCM(playerid,ZUTA,"[OOC DM Zona] Vraceni ste nazad!Ukoliko zelite napustiti OOC DM Zonu koristi /dmexit!");
            SetPlayerPos_H(playerid,-723.9285,2338.4038,126.1309);
            DMBjezanje[playerid] = 0;
        }
    }
    return 1;
}



Re: [HELP] invalid expression assumed zero - Sgt.TheDarkness - 15.01.2014

What exactly is this suppost to do, so I can get a better grasp on it


Re: [HELP] invalid expression assumed zero - Rolux - 15.01.2014

Код:
public OnPlayerEscapeDMZona(playerid,back)
{
    if(gPlayerLogged[playerid] != 1) return 1;
    if(back == 0){}
    else
    {
        if(PlayerInfo[playerid][pDM] == 1)
        {
            SCM(playerid,ZUTA,"[OOC DM Zona] Vraceni ste nazad!Ukoliko zelite napustiti OOC DM Zonu koristi /dmexit!");
            SetPlayerPos_H(playerid,424.3157,2536.3532,15.6639);
            DMBjezanje[playerid] = 0;
        }
        if(PlayerInfo[playerid][pDM] == 2)
        {
            SCM(playerid,ZUTA,"[OOC DM Zona] Vraceni ste nazad!Ukoliko zelite napustiti OOC DM Zonu koristi /dmexit!");
            SetPlayerPos_H(playerid,-723.9285,2338.4038,126.1309);
            DMBjezanje[playerid] = 0;
        }
    }
    return 1;
}
?


Re: [HELP] invalid expression assumed zero - ikey07 - 15.01.2014

He meant something like this:

pawn Код:
if(gPlayerLogged[playerid] != 1) return 1;
    if(back[playerid] > 0)
    {
        if(PlayerInfo[playerid][pDM] == 1)
        {



Re: [HELP] invalid expression assumed zero - Luca12 - 15.01.2014

This public is for detecting players who leave death match zone if the player is in it.


Re: [HELP] invalid expression assumed zero - iOxide - 15.01.2014

Try using only on‌e = ? Example if(back = 0)


Re: [HELP] invalid expression assumed zero - PowerPC603 - 15.01.2014

Код:
if(back == 0){}
The solution was already given by Rolux.

You can't have an empty block of code below an if-statement.
If it shouldn't do anything (no code), then put this after it: {}