11.04.2016, 10:07
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
IsPilotVehicle
LoadStaticVehicles
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(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.");
}
}
PHP код:
stock IsPilotVehicle(vehicleid)
{
for(new i=0; i<2; i++)
{
if(vehicleid == JobInfo[JOB_PILOT][jCars][i]) return 1;
}
return 0;
}
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