29.11.2014, 18:55
Hi all, I'm trying to get spike strips to successfully pop the appropriate tire/tires. I.e., if only the front left wheel goes over the spike, I only want that tire to be popped. However, my code doesn't pop any tires at al when I drive over spikes. Can anyone help me please?
Thanks
Code:
Thanks
Code:
Код:
public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
for(new i = 0; i < sizeof(activeroadblocks); i++){
if(activeroadblocks[i] == 2982 || activeroadblocks[i] == 2989){
new Float:x, Float:y, Float:z;
GetObjectPos(activeroadblocks[i], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)){
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
UpdateVehicleDamageStatus(carid, panels, doors, lights, 1);
}
}
}
}
return 1;
}

