30.03.2016, 12:16
I tried to create a repair command:
This has to check for the Money of the player, if its less then 2500 return a message,
If its enough AND hes in a vehicle, repair the vehicle he is in and give the player -2500 money ...
pawn Код:
CMD:repairv(playerid)
{
if(PInfo[playerid][Money] < 2500) return SendClientMessage(playerid, COLOR_RED, "You dont have enough money! ($2500)");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
GivePlayerMoney(playerid,PInfo[playerid][Money]-2500);
SendClientMessage(playerid, COLOR_LIGHTGREEN,"You repaired the vehicle (-$2500)");
return 1;
}
If its enough AND hes in a vehicle, repair the vehicle he is in and give the player -2500 money ...