vehicles
#1

Hello can anyone help me make this code only destroy vehicles created by the command /sultan, when health of vehicle is below 251?

PHP код:
forward DestroyDeadVehicles();
public 
OnGameModeInit()
{   
    
SetTimer("DestroyDeadVehicles"2000true);
}
public 
DestroyDeadVehicles()
{
    new 
Float:health;
    for(new 
i=0i<MAX_VEHICLESi++)
    {
    
GetVehicleHealth(ihealth);
    if(
health <= 251DestroyVehicle(i);
    }
    return 
1;
}
CMD:sultan(playeridparams[]) 

if(
GetPlayerMoney(playerid) == 10000

if(
IsPlayerInRangeOfPoint(playerid3.0,2140.4116,-2256.4915,13.3010)) 

    
GivePlayerMoney(playerid,-10000); 
    
CreateVehicle(560,2140.4116,-2258.4915,14.3010,180.0000,10,10,-1); 
}else{ 
SendClientMessage(playerid,COLOR_RED,"You are no in Buy Zone"); 

}else{ 
SendClientMessage(playerid,COLOR_RED,"You dont have enough money"); 

return 
1

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)