alter was schriebst du da?
mach einfach:
ocmd:refuel(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid,5,-1605.7806,-2713.6611,48.5335))
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle to use this command!");
GivePlayerMoney(playerid, -1250);
SendClientMessage(playerid,0x00FF14FF,"You succesfull refueled your vehicle!");
VehicleFuel[GetPlayerVehicleID(playerid)] = 100 + random(50);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid,5,-1404.5966,-112.2181,14.1440))
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle to use this command!");
GivePlayerMoney(playerid, -1250);
SendClientMessage(playerid,0x00FF14FF,"You succesfull refueled your vehicle!");
VehicleFuel[GetPlayerVehicleID(playerid)] = 100 + random(50);
return 1;
}
return SendClientMessage(playerid,0xFF0000FF,"You are not near a tank system!");
}
und noch:
public FuelUpdate()
{
for(new i = 1;i<MAX_VEHICLES;i++)
{
if(GetVehicleModel(i))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 1)
{
if(VehicleFuel[i] > 0) VehicleFuel[i]--;
else SetVehicleParamsEx(i,0,lights,alarm,doors,bonnet,boot,objective);
}
}
}
}
und oben nich forward FuelUpdate
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link