[FilterScript] Vehicles Auto Repair - 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] Vehicles Auto Repair (
/showthread.php?tid=516476)
Vehicles Auto Repair -
satafinix - 31.05.2014
VEHICLES AUTO REPAIR SYSTEM
Description:
Hey guys this is my New FilterScript of VEHICLES AUTO REPAIR SYSTEM By SkulleR
- Full Auto Repair!
- /Ar or /Autorepair Command to "Disable / Enable"!
Pawn code:
Код:
///////////////////////////////////////////////////////////////////////////////
//Simple Vehicle Auto Repair [FULL] By SkulleR
//Please The Credits
//Website: www.SWX-Stunting.Ga
//Enjoy it
///////////////////////////////////////////////////////////////////////////////
#include <a_samp>
forward AutoRepair();
forward AutoFlipReset();
new AutoRepairUsed[MAX_PLAYERS];
new AutoRepairTrigger[MAX_PLAYERS];
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Auto Repair Filter Script By SkulleR");
print("--------------------------------------\n");
SetTimer("AutoRepair", 1001, true);
SetTimer("AutoFlipReset", 6000, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
AutoRepairUsed[playerid] = 0;
AutoRepairTrigger[playerid] = 0;
SendClientMessage(playerid, 0x99FFFFAA, "Welcom To (YOUR SERVER NAME)");
SendClientMessage(playerid, 0x99FFFFAA, "This server using Auto Repair Fs By SkulleR");
SendClientMessage(playerid, 0x99FFFFAA, "Use /Ar or /AutoRepair To turn it on!"); ///you can edit those!
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(ar, 2, cmdtext);
dcmd(autorepair, 10, cmdtext);
return 0;
}
public AutoRepair()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{
if (AutoRepairTrigger[playerid] == 1) return 1;
if (IsPlayerInAnyVehicle(playerid))
{
if (AutoRepairUsed[playerid] == 3)
{
AutoRepairUsed[playerid] = 0;
}
new Float:CarHP;
GetVehicleHealth(GetPlayerVehicleID(playerid), CarHP);
if (CarHP < 1000)
{
new Float:X, Float:Y, Float:Z;
RepairVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid, "~r~Vehicle ~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;
}
dcmd_ar(playerid, params[])
{
#pragma unused params
if (AutoRepairTrigger[playerid] == 0)
{
AutoRepairTrigger[playerid] = 1;
SendClientMessage(playerid, 0x99FFFFAA, "Use /Ar or /AutoRepair To Enable It Again!");
return 1;
}
else if (AutoRepairTrigger[playerid] == 1)
{
AutoRepairTrigger[playerid] = 0;
SendClientMessage(playerid, 0x99FFFFAA, "AutoRepair Enabled");
return 1;
}
return 1;
}
dcmd_autorepair(playerid, params[])
{
return dcmd_ar(playerid, params);
}
Credits:
SkulleR!
Dont forGet my +REP if i helped!
Download Link (PWN/AMX):
Re: Vehicles Auto Repair -
BroZeus - 31.05.2014
Well you could make this very simple like this code --
pawn Код:
#include <a_samp>
#include <zcmd>
new bool:autofix[MAX_PLAYERS];
public OnplayerUpdate(playerid)
{
If(IsPlayerInAnyVehicle(playerid) && autofix[playerid]==true)RepairVehicle(GetPlayerVehicleID(playerid))
return 1;
}
CMD:at(playerid,params[])
{
if(autofix[playerid]==true)
{
autofix[playerid]=false;
SendClientMessage(playerid,-1,"Auto fix : {ff0000}Disabled");
}
else
{
autofix[playerid]=true;
SendClientMessage(playerid,-1,"Auto fix : {00cc00}Enabled");
}
return 1;
}
As simple as that your one is longer
Re: Vehicles Auto Repair -
Team_PRO - 31.05.2014
Easy to work, but nice enough.
Re: Vehicles Auto Repair -
Alex Magaсa - 31.05.2014
Simple good!
Re: Vehicles Auto Repair -
satafinix - 31.05.2014
Thanks Guys,
Re: Vehicles Auto Repair -
Eth - 21.06.2014
Nice
![Cheesy](images/smilies/biggrin.png)
+rep
Re: Vehicles Auto Repair -
satafinix - 21.06.2014
Thanks, Eth!