Hello!
Megcsináltam, hogy az OnPlayerExitVehicle akkor is lefusson, amikor kirángatják a kocsiból, vagy használod a RemovePlayerFromVehicle-t, stb..
Kód:
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid,\"pveh\",-1);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == -1) return 1;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) SetPVarInt(playerid,\"pveh\",GetPlayerVehicleID(playerid));
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
OnPlayerExitVehicle(playerid,GetPVarInt(playerid,\"pveh\"));
SetPVarInt(playerid,\"pveh\",-1);
}
return 1;
}