Darkround problem

Installation Problems Support
Post Reply
BandiT
Member
Member
Romania
Posts: 13
Joined: 1 Month Ago
Has thanked: 0
Been thanked: 0
Contact:

Darkround problem

#1

Post by BandiT » 1 Month 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 ?

[ Post made via iPhone ]

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 623
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#2

Post by Mohamed Alaa » 1 Month Ago

Any errors?
Edit: provide the code.

[ Post made via Android ]
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

BandiT
Member
Member
Romania
Posts: 13
Joined: 1 Month Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by BandiT » 1 Month 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
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 623
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#4

Post by Mohamed Alaa » 1 Month 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 web projects.
CS 1.6 hosting: powergamingtech.com

BandiT
Member
Member
Romania
Posts: 13
Joined: 1 Month Ago
Has thanked: 0
Been thanked: 0
Contact:

#5

Post by BandiT » 1 Month Ago

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

snitch
Member
Member
Turkey
Posts: 23
Joined: 1 Month Ago
Has thanked: 0
Been thanked: 0
Contact:

#6

Post by snitch » 1 Month Ago

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

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#7

Post by Raheem » 3 Weeks 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. }
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests