AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Money HUD Effect 0.9 (https://forums.alliedmods.net/showthread.php?t=84761)

Emp` 02-04-2009 13:06

Re: Money HUD Effect
 
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)


shine771 02-04-2009 14:53

Re: Money HUD Effect 0.8
 
Didn't notice that lol. Thanks.

jim_yang 02-04-2009 23:05

Re: Money HUD Effect 0.8
 
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

shine771 02-05-2009 09:43

Re: Money HUD Effect 0.8
 
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...

F4RR3LL 02-05-2009 15:34

Re: Money HUD Effect 0.8
 
good.

jim_yang 02-05-2009 20:28

Re: Money HUD Effect 0.8
 
http://www.sourcemod.net/devlog/?p=118

Hawk552 02-05-2009 22:59

Re: Money HUD Effect 0.8
 
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.

P4rD0nM3 02-05-2009 23:14

Re: Money HUD Effect 0.8
 
Kinda like a trickling effect am I right?

lIIusion 02-06-2009 04:28

Re: Money HUD Effect 0.8
 
Nice, this is on my server now!

Hawk552 02-06-2009 10:57

Re: Money HUD Effect 0.8
 
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.


All times are GMT -4. The time now is 02:33.

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