Darkround problem
Darkround problem
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 ?
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Any errors?
Edit: provide the code.
Edit: provide the code.
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()
}
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
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()
}
I try same error in console but now when zm win te round is shooting down...
check is_user_connected(id) first, i think it applies to all messages
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()
- }
He who fails to plan is planning to fail
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
Sign in
Who is online
Users browsing this forum: No registered users and 3 guests