AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MSG_ONE with no target entity (https://forums.alliedmods.net/showthread.php?t=113661)

TotalCS 12-29-2009 04:05

MSG_ONE with no target entity
 
Hello!I`ve got a problem with a plugin.I modified some lines and now after i die the server it`s crashing.It displays this error:
MSG_ONE or MSG_ONE_UNRELIABLE with no target entity

Code:

public event_set_power(id)
{
    message_begin(MSG_ONE, g_hide_weapon, _, id)
    write_byte(1<<4)
    message_end()
    set_task(0.1, "round_start_effects", id)
    set_task(0.5, "team_scanner", id)
    if(cs_get_user_team(id) == CS_TEAM_T)
    {
        switch(get_pcvar_num(zombie_level))
        {
            case 1:
            {
                set_task(0.1, "zombie_power_1", id)
            }
            case 2:
            {
                set_task(0.1, "zombie_power_2", id)
            }
            case 3:
            {
                set_task(0.1, "zombie_power_3", id)
            }
            case 4:
            {
                set_task(0.1, "zombie_power_4", id)
            }
            case 5:
            {
                set_task(0.1, "zombie_power_5", id)
            }
            case 6:
            {
                set_task(0.1, "zombie_power_6", id)
            }
            case 7:
            {
                set_task(0.1, "zombie_power_7", id)
            }
            case 8:
            {
                set_task(0.1, "zombie_power_8", id)
            }
            case 9:
            {
                set_task(0.1, "zombie_power_9", id)
            }
            case 10:
            {
                set_task(0.1, "zombie_power_10", id)
            }
        }
    }
}

What`s the problem? :|

Arkshine 12-29-2009 08:29

Re: MSG_ONE with no target entity
 
event_set_power() is a callback from what ?

TotalCS 12-29-2009 09:06

Re: MSG_ONE with no target entity
 
Quote:

Originally Posted by Arkshine (Post 1035088)
event_set_power() is a callback from what ?

register_event("ResetHUD", "event_set_power", "be")

Starsailor 12-29-2009 10:29

Re: MSG_ONE with no target entity
 
Use Ham_Spawn from HamSandwich module instead of ResetHud

TotalCS 12-29-2009 10:58

Re: MSG_ONE with no target entity
 
Like this?
Code:

register_event("Ham_Spawn", "event_set_power", "be")

Arkshine 12-29-2009 11:19

Re: MSG_ONE with no target entity
 
RegisterHam("Ham_Spawn", "player", "event_set_power", 1)

TotalCS 12-29-2009 11:43

Re: MSG_ONE with no target entity
 
Quote:

Originally Posted by Arkshine (Post 1035226)
RegisterHam("Ham_Spawn", "player", "event_set_power", 1)

Same error... :|

minimiller 12-29-2009 13:59

Re: MSG_ONE with no target entity
 
check is_user_alive(id)


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

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