IsPilotVehicle doesn't work
#1

I know I made such thread ealier but it was very unclear since too many codes were posted
so this is my question
I want to restrict pilot job planes to workers only

Code:
OnPlayerEnterVehicle
PHP код:
else if(IsPilotVehicle(vehicleid))
        {
            if(
PlayerInfo[playerid][pJob] != JOB_PILOT && PlayerInfo[playerid][pVIPJob] != JOB_PILOT)
            {
                  new 
Float:pos[3];
                
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
                
SetPlayerPos(playeridpos[0], pos[1], pos[2]);
                
SendClientMessage(playeridCOLOR_ORANGE"You cannot start the engine as it belongs to the Los Santos Airline Company.");
            }
        } 
IsPilotVehicle
PHP код:
stock IsPilotVehicle(vehicleid)
{
    for(new 
i=0i<2i++)
    {
        if(
vehicleid == JobInfo[JOB_PILOT][jCars][i]) return 1;
    }
    return 
0;

LoadStaticVehicles
PHP код:
    JobInfo[JOB_PILOT][jCars][0] = CreateVehicle(592,1922.0416,-2258.0427,14.7435,182.1580,1,1,0); // Trailer1
    
JobInfo[JOB_PILOT][jCars][1] = CreateVehicle(592,1873.4792,-2285.5344,14.7054,269.9822,1,1,0); // Trailer2 
Reply
#2

Anyone ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)