28.09.2012, 19:25
[AVRS]AUTO-VEHICLE REPAIR SYSTEM
Hai Guys!.. I may not be familiar as this is my second filterscript. This FilterScript auto-repairs player's vehicle on command.Inserts these lines in your gamemode or filterscript at respective places.
INCLUDES
pawn Код:
#include <a_samp>
pawn Код:
new AutoFixTimer[MAX_PLAYERS];
pawn Код:
if(!strcmp("/afix", cmdtext, true))
{
if(AutoFixTimer[playerid])
{
KillTimer(AutoFixTimer[playerid]);
AutoFixTimer[playerid] = false;
return SendClientMessage(playerid, COLOR, "Autofix stopped");
}
else
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR, "You need to be in a vehicle to start autofix");
AutoFixTimer[playerid] = SetTimerEx("AutoFix", 1000, true, "i", playerid);
return SendClientMessage(playerid, COLOR, "Autofix started");
}
return 1;
}
pawn Код:
forward AutoFix(playerid);
pawn Код:
public AutoFix(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid), Float:health;
GetVehicleHealth(vid , health);
if(health < 500) SetVehicleHealth(vid , 1000.0);
}
}
Thank you!
+Rep me if u found it useful
[NOTE] : You may use it without credits by giving a +rep