[FilterScript] [AVRS]AUTO-VEHICLE REPAIR SYSTEM - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [AVRS]AUTO-VEHICLE REPAIR SYSTEM (
/showthread.php?tid=381209)
[AVRS]AUTO-VEHICLE REPAIR SYSTEM -
Xtreme Brotherz - 28.09.2012
[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
NEWS
pawn Код:
new AutoFixTimer[MAX_PLAYERS];
ON PLAYER COMMAND TEXT
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;
}
FORWARDS
pawn Код:
forward AutoFix(playerid);
PUBLICS
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
Re: [AVRS]AUTO-VEHICLE REPAIR SYSTEM -
Lordzy - 28.09.2012
Since, I'm in mobile, I could'nt test it.
So, I've got a doubt.
How could you use
if(IsPlayerConnected(i) without looping through?
Re: [AVRS]AUTO-VEHICLE REPAIR SYSTEM -
Xtreme Brotherz - 28.09.2012
can u make it bit more clear??
Edit:: I haven't even used IsPlayerConnected in the script
Re: [AVRS]AUTO-VEHICLE REPAIR SYSTEM -
NoahF - 28.09.2012
It's pretty nice. Good work. Good job on walking through your script, and explaining everything. +REP
Re: [AVRS]AUTO-VEHICLE REPAIR SYSTEM -
martin3644 - 08.02.2013
Doesnt work for me I dont know why. Enyone knows (Old post yes, Sorry!)
Re: [AVRS]AUTO-VEHICLE REPAIR SYSTEM -
SwisherSweet - 08.02.2013
Cool.