Fliping, fixing, ect.
#1

Okay, how would i make it, where you hit a key, vehicle would flip, fix, ect. A looked at a few places for it, couldn't find anything, if you could place a link, or tell me how, thanks if you do.
Reply
#2

you want an auto repair??

pawn Код:
//at top
forward AutoRepair();
forward AutoFlipReset();

//OnGameModeInIt or OnFilterScriptInIt
SetTimer("AutoRepair", 1001, true);
SetTimer("AutoFlipReset", 6000, true);

//OnPlayerConnect
AutoRepairUsed[playerid] = 0;

//At Bottom and where you want
public AutoRepair()
{
    for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            if (AutoRepairUsed[playerid] == 3)
            {
                SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
                AutoRepairUsed[playerid] = 0;
            }
            new Float:CarHP;
            GetVehicleHealth(GetPlayerVehicleID(playerid), CarHP);
            if (CarHP < 400)
            {
                new Float:X, Float:Y, Float:Z;
                RepairVehicle(GetPlayerVehicleID(playerid));
                GameTextForPlayer(playerid, "~y~Vehicle ~r~Auto ~y~Repaired!",2000,5);
                PlayerPlaySound(playerid, 1133, X, Y, Z);
                AutoRepairUsed[playerid] = AutoRepairUsed[playerid] +1;
            }
        }
    }
    return 1;
}

public AutoFlipReset()
{
    for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
    {
        AutoRepairUsed[playerid] = 0;
    }
    return 1;
}
That an auto repair, when the car health is down to 400 then it repairs and it flips the car automatically after 4-6 repairs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)