/godcar, and /godcaroff help
#5

pawn Code:
new GodMode[MAX_PLAYERS];
//Under OnGameModeInit
SetTimer("AutoR", 2000, true);

//Under your Command Godmode (ON)
GodMode[playerid] = 1;

//Under your Command Godmode (OFF)
GodMode[playerid] = 0;

forward AutoR(playerid);
public AutoR(playerid)
{
    if(IsPlayerInAnyVehicle(playerid) && GodMode[playerid] == 1)
    {
        new vid = GetPlayerVehicleID(playerid);
        RepairVehicle(vid);
    }
    return 1;
}
And also you can make public like this
pawn Code:
public AutoR(playerid)
{
    if(IsPlayerInAnyVehicle(playerid) && GodMode[playerid] == 1)
    {
        new vid = GetPlayerVehicleID(playerid);
        new Float:health;
        GetVehicleHealth(vid, health);
        if(health <999) // or lower....
        {
            RepairVehicle(vid);
        }  
    }
}
Reply


Messages In This Thread
/godcar, and /godcaroff help - by BigAl - 22.08.2011, 15:17
Re: /godcar, and /godcaroff help - by [MWR]Blood - 22.08.2011, 15:22
Re: /godcar, and /godcaroff help - by Improvement™ - 22.08.2011, 15:30
Re: /godcar, and /godcaroff help - by BigAl - 22.08.2011, 15:31
Re: /godcar, and /godcaroff help - by Dragony92 - 22.08.2011, 16:01
Re: /godcar, and /godcaroff help - by Improvement™ - 22.08.2011, 16:47
Re: /godcar, and /godcaroff help - by =WoR=G4M3Ov3r - 22.08.2011, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)