Freeze car instead of blowing up... Help plx. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Freeze car instead of blowing up... Help plx. (
/showthread.php?tid=82538)
Freeze car instead of blowing up... Help plx. -
introzen - 18.06.2009
Hey, I've made this:
pawn Код:
new vhealth[MAX_PLAYERS];
public VehicleBroken()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(i);
if(IsPlayerInAnyVehicle(i))
{
GetVehicleHealth(vehicleid,vhealth[i]);
if(vhealth[i] < 280)
{
TogglePlayerControllable(i, 0);
SendClientMessage(i,COLOR_DARKRED,"You can't drive this car anymore the engine is damage! Get a mechanic.");
SendClientMessage(i,COLOR_DARKRED,"/exit to get out of the car");
VehicleInfo[vehicleid][vBroken] = 1;
}
}
}
return 1;
}
This is set to a timer on 10 milliseconds. But the car wont freeze when the Carhealth goes below 280...
Help please? =)
Re: Freeze car instead of blowing up... Help plx. -
GammerZ - 18.06.2009
Try
pawn Код:
if(!IsPlayerInAnyVehicle(i))
{
instead of
pawn Код:
if(IsPlayerInAnyVehicle(i))
{