Repair Command Problem
#1

See i got an problem with the repair command .

I am trying to make that the vehicle get's repaired after 15 secs , but it wont work . Give a look at this :

pawn Код:
COMMAND:repair(playerid, params[])
{
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/repair", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        // Check if the player's admin-level is at least 1
        if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            // Check if the player is inside a vehicle
            if(!IsPlayerInAnyVehicle(playerid))
                return SendClientMessage(playerid, 0xFF0000FF, "You are not in a vehicle!"); // Let the player know he's not inside a vehicle and let the server know that this was a valid command
            // Fully repair the vehicle (damage value and bodywork)
            SetTimer("Repair_CMD", 15000, false);
            SendClientMessage(playerid, 0xFF9900AA, "Assistance called . Your vehicle will be repaired in 15 minutes");
//          RepairVehicle(GetPlayerVehicleID(playerid));
            // Send the player a message to inform him that his vehicle has been repaired
//          SendClientMessage(playerid, 0x00FF00FF, "Your vehicle has been successfully repaired!");
        }
        else
            return 0;
    }
    else
        return 0;

    // Let the server know that this was a valid command
    return 1;
}
And the forwarded timer is here :

pawn Код:
public Repair_CMD()
{
          new playerid, vehicleid = GetPlayerVehicleID(playerid);
          SetVehicleHealth(vehicleid, 1000.0);
          // Send the player a message to inform him that his vehicle has been repaired
          SendClientMessage(playerid, 0x00FF00FF, "Your vehicle has been successfully repaired!");
          return 1;
}
It is already forwarded at top of script :

pawn Код:
forward Repair_CMD();
idk what's wrong with it . The message "Assistance called etc" appears but the repair wont happen . Any suggestion ?
Reply


Messages In This Thread
Repair Command Problem - by Private200 - 20.01.2013, 20:01
Re: Repair Command Problem - by Mr.Anonymous - 20.01.2013, 20:03
Re: Repair Command Problem - by Patrick - 20.01.2013, 20:05
Re: Repair Command Problem - by SilverKiller - 20.01.2013, 20:06
Re: Repair Command Problem - by Roach_ - 20.01.2013, 20:10
Re: Repair Command Problem - by Private200 - 20.01.2013, 20:15
Re: Repair Command Problem - by Roach_ - 20.01.2013, 20:19
Re: Repair Command Problem - by Private200 - 20.01.2013, 20:27
Re: Repair Command Problem - by SuperViper - 20.01.2013, 20:45
Re: Repair Command Problem - by Jewell - 21.01.2013, 01:50

Forum Jump:


Users browsing this thread: 1 Guest(s)