Page 1 of 1
Darkround problem
Posted: 18 Oct 2019, 13:54
by BandiT
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 ?
Re: Darkround problem
Posted: 20 Oct 2019, 14:31
by Night Fury
Any errors?
Edit: provide the code.
Re: Darkround problem
Posted: 20 Oct 2019, 14:48
by BandiT
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()
}
Re: Darkround problem
Posted: 20 Oct 2019, 21:41
by Night Fury
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()
}
Re: Darkround problem
Posted: 21 Oct 2019, 16:16
by BandiT
I try same error in console but now when zm win te round is shooting down...
Re: Darkround problem
Posted: 22 Oct 2019, 07:52
by snitch
check is_user_connected(id) first, i think it applies to all messages
Re: Darkround problem
Posted: 10 Nov 2019, 14:56
by Raheem
As snitch said:
#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++)
{
if (!is_user_connected(id)))
continue;
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()
}