Auto Car Repair?
#1

I found some FS about that, though of making my own. Somehow I made it but seems it's not working tho. It's not repairing car.

PHP код:
new bool:Autorepair[MAX_PLAYERS];
forward AutoRepair();
CMD:af(playerid)
{
    if(
Autorepair[playerid])
    {
        
Autorepair[playerid] = false;
        
SendClientMessage(playeridCOLOR_RED"Pakistan Drift Zone: Auto Car Repair Disabled.");
    }
    else
    {
        
Autorepair[playerid] = true;
        
SendClientMessage(playeridCOLOR_RED"Pakistan Drift Zone: Auto Car Repair enabled.");
    }
    return 
1;
}
public 
AutoRepair()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(!
Autorepair[i])
            {
                return 
0;
            }
            new 
float:gvh// Get vehicle health
            
new gvid// Get vehicle ID
            
if(IsPlayerInAnyVehicle(i))
            {
                
gvid GetPlayerVehicleID(i);
                
GetVehicleHealth(gvidgvh);
                if(
gvh 999)
                {
                    
SetVehicleHealth(gvid1000);
                    
RepairVehicle(gvid);
                }
            }
        }
    }
    return 
1;

Edit:
PHP код:
public OnPlayerConnect(playerid)
{
    
Autorepair[playerid] = false;
    return 
1;

Reply


Messages In This Thread
Auto Car Repair? - by BlackbirdXd - 10.03.2017, 09:40
Re: Auto Car Repair? - by Toroi - 10.03.2017, 09:45
Re: Auto Car Repair? - by NaS - 10.03.2017, 10:55
Re: Auto Car Repair? - by BlackbirdXd - 10.03.2017, 15:01
Re: Auto Car Repair? - by TitanX - 10.03.2017, 15:09
Re: Auto Car Repair? - by BlackbirdXd - 10.03.2017, 18:12
Re: Auto Car Repair? - by TitanX - 10.03.2017, 18:22
Re: Auto Car Repair? - by BlackbirdXd - 10.03.2017, 18:26
Re: Auto Car Repair? - by NaS - 10.03.2017, 18:37
Re: Auto Car Repair? - by Toroi - 10.03.2017, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)