SA-MP Forums Archive
Invalid Expression assumed zero , can't fix - 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: Invalid Expression assumed zero , can't fix (/showthread.php?tid=308059)



Invalid Expression assumed zero , can't fix - Immortal_LTU - 02.01.2012

hi i got error

Quote:

error 029: invalid expression, assumed zero

Line 245

Quote:

else

how i can fix it ?


Re: Invalid Expression assumed zero , can't fix - [SP]Mr.Kakashi[WP] - 02.01.2012

remove the else

give the code so we can fix it. we are not script stealer.
thats why the pro scripter is helping you to fix it


Re: Invalid Expression assumed zero , can't fix - Immortal_LTU - 02.01.2012

The Script

Quote:

if(Ccp[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 514 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 403 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
else
SendClientMessage(playerid,COLOR_RED,"Jus turite buti sunkvezimyje");
}
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 2;
SetPlayerCheckpoint(playerid,2784.6443,2585.3943,1 0.8203,3.0);
SendClientMessage(playerid,COLOR_GREEN,"Kroviniai prikrauti. Vezkti i jusu tiksla");
return 1;
}
if(Ccp[playerid] == 2)
{
new reward,string[128];
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 0;
reward = GivePlayerMoney(playerid, GetPlayerMoney(playerid) + random(5000) + 1000);
format(string,sizeof(string),"Jusu atlygis %iLt.", reward);
SendClientMessage(playerid,COLOR_GOLD,string);
}




Re: Invalid Expression assumed zero , can't fix - Norck - 02.01.2012

Check this out:
pawn Код:
if(Ccp[playerid] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 514 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 403 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
 { /* probably something is supposed to be here */}
else
SendClientMessage(playerid,COLOR_RED,"Jus turite buti sunkvezimyje");
}
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 2;
SetPlayerCheckpoint(playerid,2784.6443,2585.3943,1 0.8203,3.0);
SendClientMessage(playerid,COLOR_GREEN,"Kroviniai prikrauti. Vezkti i jusu tiksla");
return 1;
}
if(Ccp[playerid] == 2)
{
new reward,string[128];
DisablePlayerCheckpoint(playerid);
Ccp[playerid] = 0;
reward = GivePlayerMoney(playerid, GetPlayerMoney(playerid) + random(5000) + 1000);
format(string,sizeof(string),"Jusu atlygis %iLt.", reward);
SendClientMessage(playerid,COLOR_GOLD,string);
}



Re: Invalid Expression assumed zero , can't fix - Dark_Kostas - 02.01.2012

pawn Код:
if(Ccp[playerid] == 1)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 514 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 403 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            DisablePlayerCheckpoint(playerid);
            Ccp[playerid] = 2;
            SetPlayerCheckpoint(playerid,2784.6443,2585.3943,1 0.8203,3.0);
            SendClientMessage(playerid,COLOR_GREEN,"Kroviniai prikrauti. Vezkti i jusu tiksla");
            return 1;
        }
        else return SendClientMessage(playerid,COLOR_RED,"Jus turite buti sunkvezimyje");
    }
}
if(Ccp[playerid] == 2)
{
    new reward,string[128];
    DisablePlayerCheckpoint(playerid);
    Ccp[playerid] = 0;
    reward = GivePlayerMoney(playerid, GetPlayerMoney(playerid) + random(5000) + 1000);
    format(string,sizeof(string),"Jusu atlygis %iLt.", reward);
    SendClientMessage(playerid,COLOR_GOLD,string);
    return 1;
}



Re: Invalid Expression assumed zero , can't fix - Max_Coldheart - 02.01.2012

There should be no IF statement after ELSE statement. That's why it's giving you the error / warning.


Re: Invalid Expression assumed zero , can't fix - Dark_Kostas - 02.01.2012

Quote:
Originally Posted by CookieJar
Посмотреть сообщение
There should be no IF statement after ELSE statement. That's why it's giving you the error / warning.
The error is actually because the IF statement is empty and the next word is ELSE(exactly the opposite of yours message).

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 514 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 403 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)//there should be something here like {} and then the else
else



Re: Invalid Expression assumed zero , can't fix - Max_Coldheart - 02.01.2012

Quote:
Originally Posted by Dark_Kostas
Посмотреть сообщение
The error is actually because the IF statement is empty and the next word is ELSE(exactly the opposite of yours message).

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 514 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER || 403 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)//there should be something here like {} and then the else
else
Shit, didn't think about that, thanks


Re: Invalid Expression assumed zero , can't fix - Immortal_LTU - 02.01.2012

Kostas i got these error's


error 001: expected token: ",", but found "-rational value-"
C:\Documents and Settings\Parkas\Desktop\GM\gamemodes\TLF.pwn(283) : warning 215: expression has no effect
C:\Documents and Settings\Parkas\Desktop\GM\gamemodes\TLF.pwn(283) : warning 215: expression has no effect
C:\Documents and Settings\Parkas\Desktop\GM\gamemodes\TLF.pwn(283) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Parkas\Desktop\GM\gamemodes\TLF.pwn(283) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Parkas\Desktop\GM\gamemodes\TLF.pwn(283) : fatal error 107: too many error messages on one line


Re: Invalid Expression assumed zero , can't fix - Max_Coldheart - 02.01.2012

Show the lines please.