Raised This Month: $51 Target: $400
 12% 

Money HUD Effect 0.9


Post New Thread Reply   
 
Thread Tools Display Modes
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-04-2009 , 13:06   Re: Money HUD Effect
Reply With Quote #11

Code:
	register_message(get_user_msgid("Money"),"hook_money")
	
	onoff = register_cvar("amx_mhe_money","1")
	speed_per_sec = register_cvar("amx_mhe_money_speed","10")
	
	RegisterHam(Ham_Spawn,"player","player_prespawn",0)
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	
	money = get_user_msgid("Money")
->
Code:
	money = get_user_msgid("Money")
	register_message(money,"hook_money")
	
	onoff = register_cvar("amx_mhe_money","1")
	speed_per_sec = register_cvar("amx_mhe_money_speed","10")
	
	RegisterHam(Ham_Spawn,"player","player_prespawn",0)
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
shine771
Senior Member
Join Date: Jun 2007
Old 02-04-2009 , 14:53   Re: Money HUD Effect 0.8
Reply With Quote #12

Didn't notice that lol. Thanks.
shine771 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-04-2009 , 23:05   Re: Money HUD Effect 0.8
Reply With Quote #13

In your plugin there is only one set task in use, you don't need to do the taskid calculation, just use id
second, you can use this instead of task_exists in your case
Code:
new g_task[33]
public test2(id)
{
    g_task[id] = set_task(1.0, "test3", id, _, _, "b")
    return 1
}
public test3(id)
{
    static i = 0
    if(i++ < 5)
    {
         client_print(id, print_chat, "%d", i)
         return
    }
    if(g_task[id] && remove_task(id))
         g_task[id] = 0
}
besides, nice job
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
shine771
Senior Member
Join Date: Jun 2007
Old 02-05-2009 , 09:43   Re: Money HUD Effect 0.8
Reply With Quote #14

task_exists is more simple. No extra vars.. Yea i know, i should use remove_task(id) only. When i started making this plugin, i dunno why, but i was thinking of using 2 tasks with id. So i was lazy to edit it after i finished it.. anyway. If i'll make another version, i'll fix that.

Thanks all...
shine771 is offline
F4RR3LL
Member
Join Date: Jun 2008
Location: Russia :)
Old 02-05-2009 , 15:34   Re: Money HUD Effect 0.8
Reply With Quote #15

good.
__________________

F4RR3LL is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 02-05-2009 , 20:28   Re: Money HUD Effect 0.8
Reply With Quote #16

http://www.sourcemod.net/devlog/?p=118
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-05-2009 , 22:59   Re: Money HUD Effect 0.8
Reply With Quote #17

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
P4rD0nM3
Veteran Member
Join Date: Feb 2006
Old 02-05-2009 , 23:14   Re: Money HUD Effect 0.8
Reply With Quote #18

Kinda like a trickling effect am I right?
P4rD0nM3 is offline
lIIusion
BANNED
Join Date: Feb 2009
Old 02-06-2009 , 04:28   Re: Money HUD Effect 0.8
Reply With Quote #19

Nice, this is on my server now!
lIIusion is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-06-2009 , 10:57   Re: Money HUD Effect 0.8
Reply With Quote #20

Changes have been requested via PM.

See your other plugin for stylistic changes.

Code:
remove_task(id+TASK_EFFECT)

Unnecessary instructions. You never use the taskid value of id, so there's no reason to add a unique identifier for it.

Code:
set_task(0.01,"money_effect",id+TASK_EFFECT,_,_,"b")

Read my article on the set_task() function. The timer value is clamped at 0.1, so if you want something lower you'll have to use another method.

Code:
message_begin(MSG_ONE,money,_,id)

Use MSG_ONE_UNRELIABLE.

Code:
stock set_plr_money(id,Money,flash=0) {

Read my article on stocks.

This plugin is pretty good. It's a bit better than your other one, but still has some stylistic issues of inconsistency and poor readability.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



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

Forum Jump


All times are GMT -4. The time now is 04:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode