Need Help with this error - 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: Need Help with this error (
/showthread.php?tid=348730)
Need Help with this error -
Stefand - 06.06.2012
Hello need help with this error,
I get it alot and always have to post it here,
but maybe someone can fix it and also tell why i get that error...
pawn Код:
C:\Users\Stefan Dorst\Desktop\Volcom Rp\gamemodes\SRP.pwn(15034) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
command(driveroute, playerid, params[])
{
for(new h = 0; h < sizeof(Jobs); h++)
{
if(Player[playerid][Job] == h && Jobs[Player[playerid][Job]][JobType] == 6)
if(IsPlayerInVehicle(playerid, bus1) || IsPlayerInVehicle(playerid, bus2) || IsPlayerInVehicle(playerid, bus3) || IsPlayerInVehicle(playerid, bus4) || IsPlayerInVehicle(playerid, bus5))
{
TogglePlayerControllable(playerid, 1);
CP[playerid] = 200;
SetPlayerCheckpoint(playerid, 1810.2170,-1890.1097,13.4072, 4.0);
DrivingRoute[playerid] = 1;
SendClientMessage(playerid, COLOR_RED, "Please follow the checkpoints and drive safety!");
}
}
else
{
SCM(playerid, COLOR_RED,"You are not in a bus.");
}
return 1;
}
Re: Need Help with this error -
MadeMan - 06.06.2012
If you indent the code properly, maybe you can see the mistake then?
pawn Код:
command(driveroute, playerid, params[])
{
for(new h = 0; h < sizeof(Jobs); h++)
{
if(Player[playerid][Job] == h && Jobs[Player[playerid][Job]][JobType] == 6)
if(IsPlayerInVehicle(playerid, bus1) || IsPlayerInVehicle(playerid, bus2) || IsPlayerInVehicle(playerid, bus3) || IsPlayerInVehicle(playerid, bus4) || IsPlayerInVehicle(playerid, bus5))
{
TogglePlayerControllable(playerid, 1);
CP[playerid] = 200;
SetPlayerCheckpoint(playerid, 1810.2170,-1890.1097,13.4072, 4.0);
DrivingRoute[playerid] = 1;
SendClientMessage(playerid, COLOR_RED, "Please follow the checkpoints and drive safety!");
}
}
else
{
SCM(playerid, COLOR_RED,"You are not in a bus.");
}
return 1;
}
It should be if - else, not for - else