07.09.2011, 14:07
Hello, I want to make every gas station to have maximum 5000 liters, also I made 3d text to show how many liters have the gas station, but where I am in the game and refill my car with 2 liters the 3d text does not change in 4998 but its standing in 5000.
Here's the codes:
Here's the codes:
Код:
new fuelstations; public OnFilterScriptInit() { fuelstations = 5000; new stringa[256]; format(stringa,sizeof(stringa),"{0040FF}%d liters",fuelstations); Create3DTextLabel(stringa,0xE60000FF,1941.6099,-1764.9050,13.6406,40.0,0); return 1; } public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[]) { if(dialogid==FUELDIALOG && response) { if(VehicleFuel[GetPlayerVehicleID(playerid)]>=100) return SendClientMessage(playerid,0xFF0000FF,"{FF0000}The vehicle is full with fuel."); if(strval(inputtext)<=0 || strval(inputtext)>100) return SendClientMessage(playerid,0xFF0000FF,"{FFFFFF}Error: inserit a number between 0 and 100 liters."); if(VehicleFuel[GetPlayerVehicleID(playerid)]+ strval(inputtext) > 100.0) return SendClientMessage(playerid,0xFF0000FF,"{FFFFFF}You can't refill your vehicle with so many liters."); if(strval(inputtext) > fuelstations) return SendClientMessage(playerid,0xFF0000FF,"{FFFFFF}Gas station does not have as many liters of fuel."); VehicleFuel[GetPlayerVehicleID(playerid)]=VehicleFuel[GetPlayerVehicleID(playerid)]+strval(inputtext); fuelstations = fuelstations - strval(inputtext); GivePlayerMoney(playerid,-strval(inputtext)*5); return 1; } return 1; }