if(InRangeOfIcon(playerid, 11) == 1)
{
if(GetPlayerVehicleID(playerid) > 0)
{
new vid = GetPlayerVehicleID(playerid);
if(meccanicionline > 0) return SendErrorMessage(playerid, "Ci sono dei meccanici online.");
new soldi;
new Float:danno;
new str[128];
GetVehicleHealth(vid, danno);
new danno1 = floatround(danno1, floatround_tozero);
soldi = 1000-danno1;
if(Character[playerid][Cash] >= soldi)
{
GivePlayerMoneyEx(playerid, -soldi);
RepairVehicle(vid);
Vehicles[vid][Broken] = 0;
if(IsPlayerVehicle(vid)) MYSQL_Update_Interger(Vehicles[vid][SQLID], "PlayerVehicles", "Broken", 0);
format(str, sizeof(str), "Hai riparato il tuo veicolo per $%d", soldi);
SendInfoMessage(playerid, str);
return 1;
}
else
{
SendErrorMessage(playerid, ERROR_MONEY);
}
}
}
if(InRangeOfIcon(playerid, 11) == 1)
{
if(GetPlayerVehicleID(playerid) > 0)
{
new vid = GetPlayerVehicleID(playerid);
if(meccanicionline > 0) return SendErrorMessage(playerid, "Ci sono dei meccanici online.");
new soldi;
new Float:danno;
new str[128];
GetVehicleHealth(vid, danno);
new danno1 = floatround(danno1, floatround_tozero); // is danno1 here intentional? or should it be danno
soldi = 1000-danno1;
if(Character[playerid][Cash] >= soldi)
{
GivePlayerMoneyEx(playerid, -soldi);
RepairVehicle(vid);
Vehicles[vid][Broken] = 0;
if(IsPlayerVehicle(vid)) MYSQL_Update_Interger(Vehicles[vid][SQLID], "PlayerVehicles", "Broken", 0);
format(str, sizeof(str), "Hai riparato il tuo veicolo per $%d", soldi);
SendInfoMessage(playerid, str);
return 1;
}
else
{
SendErrorMessage(playerid, ERROR_MONEY);
}
}
}
It should be danno! A little negligence that ruined the entire code, thank you!
|