CMD:repararveh(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ROJO, "No estбs en un vehiculo");
new Float:health;
new veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health > 500) return SendClientMessage(playerid, COLOR_ROJO, "El auto no necesita reparaciуn.");
SetVehicleHealth(veh, 100);
RepairVehicle(playerid);
GameTextForPlayer(playerid, "~r~Vehiculo reparado", 5000, 3);
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) // ...
Eso detectarнa si el jugador estб en un vehнculo...
Es asн: pawn Код:
|
CMD:repararveh(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ROJO, "No estбs en un vehiculo");
else
{
new Float:health = GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(health > 500) return SendClientMessage(playerid, COLOR_ROJO, "El auto no necesita reparaciуn.");
SetVehicleHealth(GetPlayerVehicleID(playerid), 100.0);
//RepairVehicle(playerid); // 'playerid'? LoL.
RepairVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid, "~r~Vehiculo reparado", 5000, 3);
}
return 1;
}
SetVehicleHealth(GetPlayerVehicleID(playerid), 100.0);
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
CMD:repararveh(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ROJO, "No estбs en un vehiculo");
new Float:health = GetVehicleHealth(GetPlayerVehicleID(playerid), health);
if(health > 500) return SendClientMessage(playerid, COLOR_ROJO, "El auto no necesita reparaciуn.");
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid, "~r~Vehiculo reparado", 5000, 3);
return 1;
}