[FilterScript] CF Gas/Fuel System
#1

Fuel System

Here it goes-



Introduction

This is very simple, there is to the bottom right a textdraw with your fuel, vehicle health, and your speed in kilometers. Your fuel decreases by 1 every 3 seconds from 100. At 20, it will send a warning, "You are almost out of fuel, go to the nearest gas station!". To refuel, you simply go to a defined gas station and type /refuel, it will turn off your engine, take $20, and give you back to 100 gas. Then after done refueling, it will turn your car engine back on.

Functions

At the bottom right theres a textdraw with your fuel, vehicle health, and your speed in kilometers (This is the same). Your fuel decreased by 2 every second from 100 (Different). (It did not warn you at 20gas.). To refuel you just type /refuel anywhere (different) and it will take $80 and set your gas to 100 (different.). If you did not make it to a gas station on time, it would kick you out of your vehicle (different). (Added engine off/on)

Adding Gas Stations

Under
Код:
stock IsPlayerAtRefuelStation(playerid)
add the Co-ordinates
Код:
if (IsPlayerInRangeOfPoint(playerid,10,x,y,z)) return 1;
Gas Charges

Код:
if (GetPlayerMoney(playerid) - 20 <0) return SendClientMessage(playerid,0xFFC800FF,"You dont have enough money!");
GivePlayerMoney(playerid, -20); //Sets the player's cash -$80
Change -20 to desired prices in both the lines.

Gas Empty time

Код:
new string[128];format(string,sizeof string,"Fuel:    %i",fuel[vid] /3);
That is 1 gas every per second
Change /3 to desired number

Change Log:

At the Gas Station

You cannot move at the filling station, as engine turns off, well makes sense.
To change the time you must wait at the filling station
Under
Код:
SetTimerEx("timer_refuel",4500,false,"i",playerid);
Change 4500 to desired amount (4500 Denotes 4.5secs)

Download

http://www.mediafire.com/?lp8tjnj2tazr5f [amx+pwn] Version 1 - Old
http://rghost.net/41203563 [amx+pwn] Version 2 - New (Recommended)

Regards
Evil Junction
Reply


Messages In This Thread
Fuel System | Roleplay|CnR - by RanSEE - 03.08.2012, 13:37
Re: CF Gas/Fuel System - by Joe21 - 03.08.2012, 13:53
Re: CF Gas/Fuel System - by Lewis_Johnson - 03.08.2012, 18:02
Re: CF Gas/Fuel System - by Djole1337 - 03.08.2012, 18:20
Re: CF Gas/Fuel System - by mickos - 03.08.2012, 18:24
Re: CF Gas/Fuel System - by Ben_Gale - 04.08.2012, 00:38
Re: CF Gas/Fuel System - by RanSEE - 06.08.2012, 16:56
Re: CF Gas/Fuel System - by RanSEE - 12.08.2012, 08:57
Re: CF Gas/Fuel System - by Scott Zulkifli - 12.08.2012, 12:04
Re: CF Gas/Fuel System - by RanSEE - 28.10.2012, 07:38

Forum Jump:


Users browsing this thread: 1 Guest(s)