SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/07/2019, 04:41 PM   #1
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 512
Reputation: 18
Default Money bar

Can someone tell me which format to use to show money bar like default gta sa?

I'm talking about

$0000000000

I tried %05.3f but doesn't work.

I need it to show like default gta sa (example: if player has $20 it will show $0000000020)

Thanks.
__________________


Discord | Play Now | Website

Add your server to favourites and join our Discord.
Symon is offline   Reply With Quote
Old 24/07/2019, 04:45 PM   #2
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,529
Reputation: 554
Default Re: Money bar

%010d for example if you keep money as an integer. `0` means "prefix with zeroes", "10" means "show 10 digits", "d" means integer (also "i" can be used instead)
Misiur is offline   Reply With Quote
Old 24/07/2019, 04:51 PM   #3
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 512
Reputation: 18
Default Re: Money bar

Since i'm building a server side money system, the pMoney (the variable used in enum to handle player's money) how should i save it? Float? Integer? Decimal?
__________________


Discord | Play Now | Website

Add your server to favourites and join our Discord.
Symon is offline   Reply With Quote
Old 24/07/2019, 04:56 PM   #4
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,529
Reputation: 554
Default Re: Money bar

Integer. Float is tricky when doing math on it or comparisons, fixed point is an overkill for samp.
Misiur is offline   Reply With Quote
Old 24/07/2019, 04:57 PM   #5
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 512
Reputation: 18
Default Re: Money bar

Thank you i got it working, but got a small issue. How many zeroes has the default gta sa money bar? 10 are a bit much.
__________________


Discord | Play Now | Website

Add your server to favourites and join our Discord.
Symon is offline   Reply With Quote
Old 24/07/2019, 05:09 PM   #6
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 173
Reputation: 3
Default Re: Money bar

Quote:
Originally Posted by KeyOfKey View Post
Thank you i got it working, but got a small issue. How many zeroes has the default gta sa money bar? 10 are a bit much.
use %08d for money
NoteND is offline   Reply With Quote
Old 24/07/2019, 07:30 PM   #7
Mobtiesgangsa
Big Clucker
 
Join Date: Oct 2016
Posts: 130
Reputation: 16
Default Re: Money bar

Quote:
Originally Posted by KeyOfKey View Post
Thank you i got it working, but got a small issue. How many zeroes has the default gta sa money bar? 10 are a bit much.
The default SA Money bar has 9 digits lmao 999,999,999 is the max
Mobtiesgangsa 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
Best Anti-Money Hack Method (Server Sided Money) Discussion Dorito Discussion 15 18/12/2016 02:46 PM
[FilterScript] NexBank - Advanced Money System [ATMs] [Anti-Money Hack] [MySQL] [ZCMD] NeXoR Filterscripts 5 06/09/2016 07:01 PM
Loading Money Messup by Norn's Anti Money Hack JaKe Elite Scripting Help 0 18/05/2012 11:23 AM
[Include] money.inc - Advanced, plug-n-play, server-sided money system fiki574 Includes 7 25/02/2012 09:47 PM
[FilterScript] Ultimate Anti Money Hackers | Server Side Money ipsBruno Filterscripts 48 10/09/2011 06:49 AM


All times are GMT. The time now is 04:36 AM.


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