1)Hello! Today I want to show you my first rabotu.Kak snap all machines go to the faction.
For example, I take a fraction Doctor
and any cars with ID 416,
Let's start

All new:
HTML Code:
new pFraction[MAX_PLAYERS];//Job Variable
In public OnPlayerConnect(playerid):
HTML Code:
pFraction[playerid] = 0;//None Job
All public:
HTML Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newcar == 416) //
{
if(pFraction[playerid] == 0)//Doctor Job
{

}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "** You are not a doctor !");
}
}
return 1;
}
2)Bind just the right car

All new:
HTML Code:
new car[2];//Your Massive Car
OnGameModeInit:
HTML Code:
car[0] = AddStaticVehicle(CARID, x, y, z, rotation, color1, color2);//Choose according to your settings
car[1] = AddStaticVehicle(CARID, x, y, z, rotation, color1, color2);
And Sure Public:
HTML Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newcar >= car[0] && newcar <= car[1]) //
{
if(Ñondition)//True
{
//Code
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "** You can not go in the car !");
}
}
return 1;
}