pawn Код:
public OnTrailerUpdate(playerid, vehicleid)
{
Trailer[vehicleid] = GetVehicleTrailer(vehicleid);
return 1;
}
public OnPlayerUpdate(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid) && !IsTrailerAttachedToVehicle(vehicleid))
{
if(Trailer[vehicleid] != INVALID_PLAYER_ID)
{
CallLocalFunction("OnTrailerDetach", "id", playerid, vehicleid, Trailer[vehicleid]);
Trailer[vehicleid] = INVALID_VEHICLE_ID;
return true;
}
}
return true;
}