[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
#2

good job !
Reply
#3

You won't believe how long I've been looking for something like this!
I love you!
Reply
#4

Already had something like that^, scripted by me,

good job.
Reply
#5

Good job
Reply
#6

i shall be trying this out let u kniw !
Reply
#7

Thank you very much, glad that you like it.
Reply
#8

Updated Check the main post.


Код:
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
Code:
SetTimerEx("timer_refuel",4500,false,"i",playerid);
Change 4500 to desired amount (4500 Denotes 4.5secs)
Reply
#9

nice..
Reply
#10

Version 2 Out
Link Updated
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)