08.12.2011, 16:42
Alright, so I need to optimize one script part as it gives huge CPU usage.
this
or
In basic its scipt which will auto set car HP to 251 if its under 250 ( starts burning )
Player is needed as its also check if player HP isnt under 15, if so he cant drive the car
Thank you in advice
this
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++) //1700
{
GetVehicleHealth(i,VHP);
foreach(Player,playerid)
{
//Script
}
}
pawn Код:
foreach(Player,playerid)
{
if(GetPlayerState(playerid) == 2)
{
new i = GetPlayerVehicleID(playerid);
GetVehicleHealth(i,VHP);
//Script
}
}
Player is needed as its also check if player HP isnt under 15, if so he cant drive the car
Thank you in advice