Repair Abuse
#2

Try this:

pawn Code:
new bool:RepairedCar[MAX_PLAYERS]; //put this outside the command/function/callback
new RepairedCarTimer[MAX_PLAYERS]; //put this outside the command/function/callback

forward RepairedCarReset(playerid);  //put this outside the command/function/callback
public RepairedCarReset(playerid)   //put this outside the command/function/callback
{
    if(RepairedCar[playerid])
    {
        RepairedCar[playerid] = false;
    }
    return 1;
}


if(IsPlayerInAnyVehicle(playerid))
{
     if(newkeys & KEY_ANALOG_UP) // NumPad 8
    {
        if(!RepairedCar[playerid])
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            SetVehicleHealth(vehicleid, 1000.0);
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, 0x800080FF, "[ Server ] Vehicle repaired.");
            RepairedCar[playerid] = true;
            RepairedCarTimer[playerid] = SetTimerEx("RepairedCarReset",10000,false,"i",playerid); //10000 is the timer, it's set as 10seconds. After the command, they have to wait 10seconds to do it again. Change this to whatever you want. 25seconds would be 250000.
            return 1;
        }
        else return SendClientMessage(playerid, 0x800080FF, "[ Server ] You cannot do this command yet!");
    }
Reply


Messages In This Thread
Repair Abuse - by MBilal - 30.09.2013, 12:50
Re: Repair Abuse - by EiresJason - 30.09.2013, 13:06
Re: Repair Abuse - by Konstantinos - 30.09.2013, 13:08
Re: Repair Abuse - by MBilal - 30.09.2013, 13:09
Re: Repair Abuse - by MBilal - 30.09.2013, 13:28
Re: Repair Abuse - by xganyx - 30.09.2013, 13:28
Re: Repair Abuse - by Konstantinos - 30.09.2013, 13:34
Re: Repair Abuse - by MBilal - 30.09.2013, 13:38
Re: Repair Abuse - by xganyx - 30.09.2013, 13:49
Re: Repair Abuse - by MBilal - 30.09.2013, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)