SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 05/09/2018, 05:36 PM   #1
CaptainBoi
Huge Clucker
 
Join Date: May 2018
Location: India
Posts: 251
Reputation: 25
Default moneybar.inc || Coloured Moneybar || Released

Introduction
I just had made an money bar for my new server then i was searching for money bars on g00gle if i get one so i didnot found any which can help me then finnaly i made it by trying it
and i thought to make it an include and release it.

Pictures


Changelog
Code:
_____________________ ChangeLog ___________________
---------------------------- Version 1.1 -------------------------
-------------------------------------------------------------------
- Added FilterScript/OnGameMode Support

---------------------------- Version 1.0 -------------------------
-------------------------------------------------------------------
- Released
Examples
Code:
CreateMoneyBar(playerid, txdboxcolor, txdtextcolor);
Download
Pastebin - Moneybar (Include)
Pastebin - Moneybar (Complete Example)

Credits
Code:
/**********************************
 *                                *
  *   Scripter:    CaptainBoi    *
  *   Version:     1             *
  *   Released:    05-09-2018    *
 *                                *
 **********************************/
__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer

Last edited by CaptainBoi; 05/09/2018 at 06:41 PM.
CaptainBoi is offline   Reply With Quote
Old 05/09/2018, 06:15 PM   #2
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Posts: 1,587
Reputation: 483
Default Re: moneybar.inc || Coloured Moneybar || Released

Looks good, but you made one logical mistake.

If I create moneybars for 500 players, this will use 500 global textdraws since it creates the box everytime I use CreateMoneyBar. The worst part is that the first 499 will have no reference and cannot be deleted anymore.

Put the code for creating the box into OnGameModeInit/OnFilterScriptInit and destroy it in OnGameModeExit/OnFilterScriptExit.

Talking of that this won't properly work in filterscripts since you only hooked OnGameModeInit/Exit.
Also the Money Bars should be deleted when the filterscript is unloaded. Use the define "FILTERSCRIPT" to know if the script it is included in is a filterscript or gamemode.

So far you specifically disallow filterscripts (endinput if filterscript) but that doesn't make sense to me. Why not allow it for both?
NaS is offline   Reply With Quote
Old 05/09/2018, 06:42 PM   #3
CaptainBoi
Huge Clucker
 
Join Date: May 2018
Location: India
Posts: 251
Reputation: 25
Default Re: moneybar.inc || Coloured Moneybar || Released

Added Filtersccript/OnGameModeinit
as you said
Thanks.
__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 05/09/2018, 07:12 PM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,175
Reputation: 351
Default Re: moneybar.inc || Coloured Moneybar || Released

I see no design over the textdraw its just numbers and a black box, could've at least made any sort of a change since it's basically the same as the old one with just a different color? (And a black box in the background which doesn't look very nice)

Also could've been more concise, and i see missing code over the hooks, you should read the include tutorial by Lordzy http://forum.sa-mp.com/showthread.php?t=497081 .

Shouldn't use CallLocalFunction it's slower than a direct call with a check for defenition, i don't care how insignificant the time difference is to you but it's still a fact, it is slower.

Also is it just me or is the code not even indented? And the variable naming is horrible 'new bool:False = false' what even is this? and its too common i can see it causing problems for big scripts.

I don't see any need for this at all:
Code:
#define PlayerTextDrawSetStrings(%1,%2,%3,%4)\
do{\
    format(ptdssws, sizeof (ptdssws), (%3), %4);\
    PlayerTextDrawSetString((%1), (%2), ptdssws);\
}\
while (False)
I also am not sure if this 'ptdssws' variable should be global. (What a name as well). You're not even checking if the textdraw is created before doing that timer gonig through all players :/ ' for(new i;i<MAX_PLAYERS;i++)' could've also been done better. (See GetPlayerPoolSize() through the wiki)

Anyhow i'm sure you could've done this better, props on your effort into this but try to keep improving things more and adding a value to it, good luck.
__________________

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is offline   Reply With Quote
Old 05/09/2018, 07:39 PM   #5
CaptainBoi
Huge Clucker
 
Join Date: May 2018
Location: India
Posts: 251
Reputation: 25
Default Re: moneybar.inc || Coloured Moneybar || Released

well that ptdssws means 'playertextdrawsetstringwithstring' xD
well after reading your post i am gonna improve alot
thanks
__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 28/10/2018, 09:57 AM   #6
RajatAsthana
Little Clucker
 
Join Date: Oct 2018
Posts: 8
Reputation: 0
Default Re: moneybar.inc || Coloured Moneybar || Released

Looks cool, i am gonna use it +REP
RajatAsthana is offline   Reply With Quote
Old 07/11/2018, 05:01 PM   #7
CaptainBoi
Huge Clucker
 
Join Date: May 2018
Location: India
Posts: 251
Reputation: 25
Default Re: moneybar.inc || Coloured Moneybar || Released

Quote:
Originally Posted by RajatAsthana View Post
Looks cool, i am gonna use it +REP
Thanks
__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 08/11/2018, 07:50 PM   #8
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,825
Reputation: 603
Default Re: moneybar.inc || Coloured Moneybar || Released

You could just use the right money font with the right font size and all and it will overlap the old one perfectly. Trust me it's possible and it works across different screen dimensions. It's a lot more purdy that way
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 08/11/2018, 08:17 PM   #9
cSharp
Little Clucker
 
Join Date: Oct 2018
Posts: 36
Reputation: 1
Default Re: moneybar.inc || Coloured Moneybar || Released

Anyone who's considering using this include on a public build, please don't. As a GTA SA player, I mod my game as I want it, including, my UI. So does pretty much everyone else. Don't ruin the user interface.

Not only does this look terrible, but the code also is.
cSharp is offline   Reply With Quote
Old 08/11/2018, 09:07 PM   #10
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,825
Reputation: 603
Default Re: moneybar.inc || Coloured Moneybar || Released

Quote:
Originally Posted by cSharp View Post
Anyone who's considering using this include on a public build, please don't. As a GTA SA player, I mod my game as I want it, including, my UI. So does pretty much everyone else. Don't ruin the user interface.

Not only does this look terrible, but the code also is.
Get the haeellll out of here. Nobody cares about your mods. We build servers, you play the game. You mod your game then you deal with the consequences. Don't come here bashing people because they released something that doesn't comply with your bullshit.


EDIT: Note that I'm not being rude. I just get tired of people bashing releases because they aren't what they want or because of mods that barely a percentage of people use.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder 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
Server Sided Money and MoneyBar desync problem SkyFlare Scripting Help 7 30/01/2016 11:58 AM
Question about MoneyBar and Textdraws [ I give rep thanks! ] buburuzu19 Scripting Help 4 27/10/2014 03:43 PM
[Ajuda] Moneybar vermelho caption PortuguÍs/Portuguese 7 14/11/2013 12:09 PM
moneybar thekiller01 Scripting Help 0 13/04/2012 07:25 PM
Textdraws, menu text and moneybar fading WTF!? Pooh7 Help Archive 4 23/01/2011 01:57 PM


All times are GMT. The time now is 03:35 AM.


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