06.02.2011, 12:15
pawn Код:
stock PutPlayerInVehicleEx(playerid, vehicleid, seatid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
CallRemoteFunction("OnPlayerStateChange", "iii", playerid, PLAYER_STATE_ONFOOT, PLAYER_STATE_DRIVER);
PutPlayerInVehicle(playerid, vehicleid, seatid);
CallRemoteFunction("OnPlayerStateChange", "iii", playerid, PLAYER_STATE_DRIVER, PLAYER_STATE_ONFOOT);
return 1;
}
else if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
CallRemoteFunction("OnPlayerStateChange", "iii", playerid, PLAYER_STATE_ONFOOT, PLAYER_STATE_PASSENGER);
PutPlayerInVehicle(playerid, vehicleid, seatid);
CallRemoteFunction("OnPlayerStateChange", "iii", playerid, PLAYER_STATE_PASSENGER, PLAYER_STATE_ONFOOT);
return 1;
}
else return PutPlayerInVehicle(playerid, vehicleid, seatid);
}
(Won't work, if PutPlayerInVehicle will be called in another method)