[Include] moneybar.inc || Coloured Moneybar || Released
#1

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
Код:
_____________________ ChangeLog ___________________
---------------------------- Version 1.1 -------------------------
-------------------------------------------------------------------
- Added FilterScript/OnGameMode Support

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

Credits
Код:
/**********************************
 *                                *
  *   Scripter:    CaptainBoi    *
  *   Version:     1             *
  *   Released:    05-09-2018    *
 *                                *
 **********************************/
Reply
#2

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?
Reply
#3

Added Filtersccript/OnGameModeinit
as you said
Thanks.
Reply
#4

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 https://sampforum.blast.hk/showthread.php?tid=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:
Код:
#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.
Reply
#5

well that ptdssws means 'playertextdrawsetstringwithstring' xD
well after reading your post i am gonna improve alot
thanks
Reply
#6

Looks cool, i am gonna use it +REP
Reply
#7

Quote:
Originally Posted by RajatAsthana
Посмотреть сообщение
Looks cool, i am gonna use it +REP
Thanks
Reply
#8

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
Reply
#9

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.
Reply
#10

Quote:
Originally Posted by cSharp
Посмотреть сообщение
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.
Reply
#11

Quote:
Originally Posted by Crayder
Посмотреть сообщение
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.
So having an opinion isn't allowed anymore? Giving out feedback isn't allowed anymore? What is this? Ubi complying with Chinese censorship, but SA: MP instead? Yeah, thought so.

Either way, here, have a much fucking cleaner version of this bs: https://pastebin.com/NMtkvV3P
Reply
#12

Quote:
Originally Posted by cSharp
Посмотреть сообщение
So having an opinion isn't allowed anymore? Giving out feedback isn't allowed anymore? What is this? Ubi complying with Chinese censorship, but SA: MP instead? Yeah, thought so.

Either way, here, have a much fucking cleaner version of this bs: https://pastebin.com/NMtkvV3P
Your "opinion" or "feedback" was telling people not to use this release. That's in no way fair for anyone, simply because you want to use a mod.
Reply
#13

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Your "opinion" or "feedback" was telling people not to use this release. That's in no way fair for anyone, simply because you want to use a mod.
So giving my opinion of something like this as a PLAYER of SA:MP isn't allowed? Straight up censorship in my eyes.

Dude created an ugly as fuck text draw, I don't want to see that shit on my screen. I gave my opinion. Deal with it and take your PTSD somewhere else.
Reply
#14

Don't declare variables with common names (like False) in an include.This restrict user writing script with this include from using that variable name .You can declare the variable as static to restrict it's scope within the include and also use better naming conventions when declaring.

There is still a lot of scope for improvement but good job on the effort
Reply
#15

Good Job Captain
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)