stock IsPilotVehicle(vehicleid)
{
printf("Test: %s.", vehicleid);
for(new i=0; i<2; i++)
{
if(vehicleid == JobInfo[JOB_PILOT][jCars][i]) return 1;
}
return 0;
}
else if(IsPilotVehicle(vehicleid))
{
printf("Test = %i.", vehicleid);
if(PlayerInfo[playerid][pJob] != JOB_PILOT && PlayerInfo[playerid][pVIPJob] != JOB_PILOT)
{
printf("TEST = %i.",vehicleid);
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SendClientMessage(playerid, COLOR_ORANGE, "You cannot start the engine as it belongs to the Los Santos Airline Company.");
}
}
Is something else inside of your "if - else - else if " construct called? Just add print("Test"); or smth to check it
|
First off you use %s for an integer, make it a %d or %i.
Also, what does the if before "else if(IsPilotVehicle(vehicleid))" check for? |
The rest of the public OnPlayerEnterVehicle
If hes not a cop cant enter LSPD cars, if hes not a GOV cant enter GOV cars etc etc |
Does that work correctly (the ones before the pilot)?
It seems that the whole else if doesn't get called, so the if structure just before your IsPilotVehicle could be wrong. And did you change the %s to %d in the first printf inside your IsPilotVehicle function? |