06.06.2012, 15:46
If you indent the code properly, maybe you can see the mistake then?
It should be if - else, not for - else
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;
}