20.01.2013, 20:19
(
Последний раз редактировалось Roach_; 21.01.2013 в 06:56.
)
Try this:
EDIT: And change "forward Repair_CMD();" to "forward Repair_CMD(playerid);"
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]) return 0;
// Check if the player's admin-level is at least 1
if(APlayerData[playerid][PlayerLevel] < 1) return 0;
// 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)
SetTimerEx("Repair_CMD", 15000, false, "i", playerid);
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!");
// Let the server know that this was a valid command
return 1;
}
public Repair_CMD(playerid)
{
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!");
return 1;
}