16.03.2017, 19:24
PHP код:
CMD:ripara(playerid, params[])
{
new id=GetPlayerVehicleID(playerid);
if(PlayerToPoint(6.0, playerid, 992.987121,-1659.088134,14.559866) || PlayerToPoint(6.0, playerid, 992.834289,-1650.768920,14.559599) && IsPlayerInAnyVehicle(playerid))
{
new Float:health;
new str[128];
new Float:vh = GetVehicleHealth(id,health); // pasta pizza bambino, you don't need here to create a new Float:vh as you've already retrieved the vehicle's health on the variable health.
new vhealth = floatround(vh, floatround_round); // pasta pizza bambino, you need to change vh for health again here
new totale = 999-vhealth;
RepairVehicle(id);
format(str,sizeof(str),"Hai riparato il tuo veicolo per %i", totale);
SCM(playerid, INFO, str);
GivePlayerMoney(playerid, -totale);
SetVehicleHealth(id, 999.0);
VeicoloInfo[(id)][vVita] = 999.0;
Salvaveh((id));
Salvataggio(playerid);
}
return 1;
}
So, instead of the lines I pointed out up there, they should look like this:
Код:
GetVehicleHealth(id,health); new vhealth = floatround(health);