[Include] moneybar.inc || Coloured Moneybar || Released
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)