Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) //linia asta
- {
- new Float:TempFloatX, Float:TempFloatY, Float:TempFloatZ;
- new ActTempState, ActTempCar;
- if(vel_z >= 300.000000)
- {
- SetVehicleToRespawn(vehicleid);
- GetVehiclePos(vehicleid, TempFloatX, TempFloatY, TempFloatZ);
- for(new x; x < MAX_VEHICLES; x++)
- {
- if(!IsValidVehicle(x) || vehicleData[x][broadVehicleOwner] != INVALID_PLAYER_ID) continue;
- if(GetVehicleDistanceFromPoint(vehicleid, TempFloatX, TempFloatY, TempFloatZ) <= 20) SetVehicleToRespawn(x);
- }
- for(new i, j = GetPlayerPoolSize(); i <= j; i++)
- {
- ActTempState = GetPlayerState(i);
- ActTempCar = GetPlayerVehicleID(i);
- if(!IsPlayerConnected(i)) continue;
- if(IsPlayerInRangeOfPoint(i, 4.0, new_x, new_y, new_z))
- {
- if (i != playerid)
- {
- if(ActTempState != PLAYER_STATE_ONFOOT) GetVehiclePos(ActTempCar, TempFloatX, TempFloatY, TempFloatZ);
- SetPlayerHealthEx(playerid, 0.0);
- if(ActTempState == PLAYER_STATE_ONFOOT && !playerData[i][playerCarsFix])
- {
- playerData[i][playerCarsFix] = true,
- TogglePlayerControllable(i, 0),
- SetTimerEx("ResetVariableValues", 2500, false, "ii", i, 7);
- }
- else if(ActTempState != PLAYER_STATE_ONFOOT && !playerData[i][playerCarsFix])
- {
- SetVehicleToRespawn(ActTempCar);
- playerData[i][playerCarsFix] = true,
- TogglePlayerControllable(i, 0),
- SetTimerEx("ResetVariableValues", 2500, false, "ii", i, 7);
- }
- DetectTrollCheat(playerid, vehicleid, i, RACT_KICKPLAYER_CAR);
- break;
- }
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment