SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/04/2017, 09:14 AM   #1
Imbalo
Big Clucker
 
Join Date: Mar 2017
Location: Indonesia
Posts: 66
Reputation: 0
Default Fuel System

I was working on the fuel system, so I had a problem. I want to make the fuel originally 10.00 and 00.20 every 10 seconds reduced.

example: fuel beginning 10.00 then I walk for 10 seconds then my fuel left over 09.80 . How to ?
Imbalo is offline   Reply With Quote
Old 04/04/2017, 01:59 PM   #2
AndreiWow
High-roller
 
AndreiWow's Avatar
 
Join Date: Nov 2014
Location: Romania, Bucharest
Posts: 1,046
Reputation: 48
Default Re: Fuel System

You can use a float.
Read more about floats here: http://wiki.sa-mp.com/wiki/Floats
AndreiWow is offline   Reply With Quote
Old 04/04/2017, 03:11 PM   #3
Imbalo
Big Clucker
 
Join Date: Mar 2017
Location: Indonesia
Posts: 66
Reputation: 0
Default Re: Fuel System

Can You Give me example with my case ?
Imbalo is offline   Reply With Quote
Old 04/04/2017, 08:06 PM   #4
AndreiWow
High-roller
 
AndreiWow's Avatar
 
Join Date: Nov 2014
Location: Romania, Bucharest
Posts: 1,046
Reputation: 48
Default Re: Fuel System

Well uh.. probably

new Float:Fuel = 10.00;

and to lower it you could use
Fuel -= 00.20;
AndreiWow is offline   Reply With Quote
Old 05/04/2017, 01:34 AM   #5
Imbalo
Big Clucker
 
Join Date: Mar 2017
Location: Indonesia
Posts: 66
Reputation: 0
Default Re: Fuel System

Thanks man
Imbalo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fuel System - No Fuel Scottylad Scripting Help 3 31/10/2015 12:51 AM
[FilterScript] Speedometer + motor system + fuel system[zcmd]. Darknoobster Filterscripts 10 09/04/2015 09:43 PM
[FilterScript] Fuel System [Fuel/Speed/Vehicle Name/Health] reddromero Filterscripts 5 10/05/2014 02:50 AM
Custom Fuel system taking 2 fuel instead of 1. ricardo178 Scripting Help 6 27/04/2013 10:16 AM


All times are GMT. The time now is 05:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.