Darkround problem

Installation Problems Support
Post Reply
BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

Darkround problem

#1

Post by BandiT » 4 years ago

Hello everyone i’m new on forum, and instal the plugin “darkround” in my serverc everething good plugin work, but i have a problem, when os darkround on when i’m and i infect a human my server is shootingdown, cane someone help me with this ?

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 4 years ago

Any errors?
Edit: provide the code.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

#3

Post by BandiT » 4 years ago

I have no erros when i compile the plugins but i have this error in console

Code: Select all

FATAL ERROR (shutting down): Host_Error: WriteDest_Parm: not a client
./hlds_r_101: line 53: 45184 Segmentation fault      ${HL} "$@"

Code: Select all

#include <zombie_escape>
 
#define DARKSOUND "dark/darkness.wav"
#define DEFAULT_LIGHT "d"
 
new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
 
public plugin_init()
{
    register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
   
    // Pointers
    g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
    g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
   
    // Check rounds number
    new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
   
    // Get random round
    g_iRandomRoundNum = random_num(0, iRoundsNumber)
   
    // Set counter to 0 first round
    g_iRoundNum = 0
   
    // Dark round false
    g_bDarkRoundCome = false
}
 
public plugin_precache()
{
    precache_sound(DARKSOUND)
}
 
public ze_game_started()
{
    if (g_iRoundNum == g_iRandomRoundNum)
    {
        for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
        {
            if (!is_user_connected(id))
                continue
           
            PlaySound(id, DARKSOUND)
        }
 
        server_cmd("ze_lighting_style a")
        client_cmd(0, "gl_fog 0")
        g_bDarkRoundCome = true
        ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
    }
   
    g_iRoundNum++
}
 
public ze_roundend(WinTeam)
{
    if (g_bDarkRoundCome == true)
    {
        server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
        Send_Cmd(0, "gl_fog 1")
        g_bDarkRoundCome = false
    }
}
 
stock Send_Cmd(id, text[])
{
    message_begin(MSG_ONE, 51, _, id)
    write_byte(strlen(text) + 2)
    write_byte(10)
    write_string(text)
    message_end()
}

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#4

Post by Night Fury » 4 years ago

Try this:

Code: Select all

#include <zombie_escape>
 
#define DARKSOUND "dark/darkness.wav"
#define DEFAULT_LIGHT "d"
 
new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
 
public plugin_init()
{
    register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
   
    // Pointers
    g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
    g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
   
    // Check rounds number
    new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
   
    // Get random round
    g_iRandomRoundNum = random_num(0, iRoundsNumber)
   
    // Set counter to 0 first round
    g_iRoundNum = 0
   
    // Dark round false
    g_bDarkRoundCome = false
}
 
public plugin_precache()
{
    precache_sound(DARKSOUND)
}
 
public ze_game_started()
{
    if (g_iRoundNum == g_iRandomRoundNum)
    {
        for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
        {
            if (!is_user_connected(id))
                continue
           
            PlaySound(id, DARKSOUND)
        }
 
        server_cmd("ze_lighting_style a")
        client_cmd(0, "gl_fog 0")
        g_bDarkRoundCome = true
        ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
    }
   
    g_iRoundNum++
}
 
public ze_roundend(WinTeam)
{
    if (g_bDarkRoundCome == true)
    {
        server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
        for (new i = 0; i < get_member_game(m_nMaxPlayers); i++)
        {
            Send_Cmd(i, "gl_fog 1")
        }
        g_bDarkRoundCome = false
    }
}
 
stock Send_Cmd(id, text[])
{
    message_begin(MSG_ONE, 51, _, id)
    write_byte(strlen(text) + 2)
    write_byte(10)
    write_string(text)
    message_end()
}
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

#5

Post by BandiT » 4 years ago

I try same error in console but now when zm win te round is shooting down...

snitch
Member
Member
Turkey
Posts: 24
Joined: 4 years ago
Contact:

#6

Post by snitch » 4 years ago

check is_user_connected(id) first, i think it applies to all messages

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#7

Post by Raheem » 4 years ago

As snitch said:
    1. #include <zombie_escape>
    2.  
    3. #define DARKSOUND "dark/darkness.wav"
    4. #define DEFAULT_LIGHT "d"
    5.  
    6. new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
    7.  
    8. public plugin_init()
    9. {
    10.     register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
    11.    
    12.     // Pointers
    13.     g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
    14.     g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
    15.    
    16.     // Check rounds number
    17.     new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
    18.    
    19.     // Get random round
    20.     g_iRandomRoundNum = random_num(0, iRoundsNumber)
    21.    
    22.     // Set counter to 0 first round
    23.     g_iRoundNum = 0
    24.    
    25.     // Dark round false
    26.     g_bDarkRoundCome = false
    27. }
    28.  
    29. public plugin_precache()
    30. {
    31.     precache_sound(DARKSOUND)
    32. }
    33.  
    34. public ze_game_started()
    35. {
    36.     if (g_iRoundNum == g_iRandomRoundNum)
    37.     {
    38.         for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
    39.         {
    40.             if (!is_user_connected(id))
    41.                 continue
    42.            
    43.             PlaySound(id, DARKSOUND)
    44.         }
    45.  
    46.         server_cmd("ze_lighting_style a")
    47.         client_cmd(0, "gl_fog 0")
    48.         g_bDarkRoundCome = true
    49.         ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
    50.     }
    51.    
    52.     g_iRoundNum++
    53. }
    54.  
    55. public ze_roundend(WinTeam)
    56. {
    57.     if (g_bDarkRoundCome == true)
    58.     {
    59.         server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
    60.         for (new i = 0; i < get_member_game(m_nMaxPlayers); i++)
    61.         {
    62.             if (!is_user_connected(id)))
    63.                 continue;
    64.            
    65.             Send_Cmd(i, "gl_fog 1")
    66.         }
    67.         g_bDarkRoundCome = false
    68.     }
    69. }
    70.  
    71. stock Send_Cmd(id, text[])
    72. {
    73.     message_begin(MSG_ONE, 51, _, id)
    74.     write_byte(strlen(text) + 2)
    75.     write_byte(10)
    76.     write_string(text)
    77.     message_end()
    78. }
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: Bing [Bot] and 6 guests