[FilterScript] [AVRS]AUTO-VEHICLE REPAIR SYSTEM
#1

[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>
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
Reply
#2

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?
Reply
#3

can u make it bit more clear??

Edit:: I haven't even used IsPlayerConnected in the script
Reply
#4

It's pretty nice. Good work. Good job on walking through your script, and explaining everything. +REP
Reply
#5

Doesnt work for me I dont know why. Enyone knows (Old post yes, Sorry!)
Reply
#6

Cool.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)