Invalid Expression assumed zero , can't fix
#1

hi i got error

Quote:

error 029: invalid expression, assumed zero

Line 245

Quote:

else

how i can fix it ?
Reply
#2

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

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);
}

Reply
#4

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);
}
Reply
#5

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;
}
Reply
#6

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

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

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

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

Show the lines please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)