05.11.2011, 16:50
PHP код:
// PUBLIC OnPlayerCommandText
if(strcmp(cmdtext,"/repararveiculo", true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, LOCAL_X, LOCAL_Y, LOCAL_Z)) return SendClientMessage(playerid, -1,"Vocк nгo estб em um local apropriado.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"Vocк nгo estб em nenhum veнculo.");
SendClientMessage(playerid, 0xFFFF00FF, "[INFO] {00FF00}Consertando carro ...");
TogglePlayerControllable(playerid,0);
SetTimerEx("Conserto", 5000, false, "ii", playerid, GetPlayerVehicleID(playerid));
return 1;
}
// FINAL DO GM
forward Conserto(playerid, carid);
public Conserto(playerid, carid)
{
format(string, sizeof(string), "{FFFF00}[INFO] {00FF00} Carro Consertado com Sucesso!", aname, playerid);
SendClientMessage(playerid, AzuL4, string);
RepairVehicle(carid);
SetVehicleHealth(carid, 1000);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, -100);
return 1;
}