13.06.2013, 04:11
OnPlayerEnterVehicle calls whenever the person hits the button to enter the vehicle, and is close enough to the vehicle. Try setting the players pos. e.g:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new playercar = GetPlayerVehicleID(playerid);
new newstate = GetPlayerState(playerid);
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(playercar) == 432)
{
if(class[playerid][Mechanic] < 1) return SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
}
if(GetVehicleModel(playercar) == 520 && GetVehicleModel(playercar) == 425)
{
if(class[playerid][Pilot] < 1) return SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
}
}
return 1;
}