24.06.2011, 10:32
to check for the vehicle types (id), you need the GetVehicleModel(vehicleid) , maybe you need to include a GetVehicleSpeed?
Код:
public OnPlayerUpdate(playerid) { new vehicleid = GetPlayerVehicleID(playerid); new modelid= GetVehicleModel(vehicleid); if(IsPlayerInAnyVehicle(playerid) && modelid == 437 && GetPlayerSpeed(playerid) > 60 && gBreakDown[playerid] == 0) { gBreakDown[playerid] = 1; SendClientMessage(playerid,COLOR_RED,"A bomb has been planted in your bus and if you slow down below 40 km/h,you'll be blowed up"); } if(IsPlayerInAnyVehicle(playerid) && modelid == 437 && gBreakDown[playerid] == 1 && GetPlayerSpeed(playerid) < 41) { gBreakDown[playerid] = 0; SendClientMessage(playerid,COLOR_RED,"You didn't obey the rule,BYE BYE!!!"); SetVehicleHealth(vehicleid,0); } return 1; }