13.07.2010, 04:40
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.
//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;
}