Post by ShaunCraft15 on Dec 27, 2021 13:15:25 GMT
Hello Guys I have Problem in my plugin is nightvision changer for zp if round started as zombie will be get the error
"new message started when message '23' has not been sent yet"
Here My Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Simple NightVision Menu (Test)"
#define VERSION "1.0"
#define AUTHOR "ShaunCraft"
#define MAXPLAYERS 32
new NightVisionMode[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /nvisionmenu", "zp_nvisionmenu")
}
public plugin_natives()
{
register_native("zp_show_nvisionmenu", "native_showmenu", 1)
register_native("zp_get_nivison_info", "native_info", 1)
}
public native_showmenu(id) zp_nvisionmenu(id)
public native_info(id, c1, c2, c3) SetPlayerAura(id, c1, c2, c3)
public zp_nvisionmenu(id)
{
new iMenu = menu_create("Change NightVision Settings", "commands")
menu_additem(iMenu, "Default")
menu_additem(iMenu, "ScreenFade")
menu_additem(iMenu, "Default (Low Radius)")
menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL );
menu_display(id, iMenu, 0 );
}
public commands(id, menu, item)
{
switch(item)
{
case 1: NightVisionMode[id] = 1
case 2: NightVisionMode[id] = 2
case 3: NightVisionMode[id] = 3
}
}
public SetPlayerAura(id, c1, c2, c3)
{
new org[3]
new Players[MAXPLAYERS], i, PlayerCount, iPlayer
get_players(Players, PlayerCount, "c")
get_user_origin(iPlayer, org)
for (i = 0; i < PlayerCount; i++)
{
iPlayer = Players[i];
if(NightVisionMode[iPlayer] == 1)
{
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, .player = iPlayer)
write_byte(TE_DLIGHT) // TE id
write_coord(org[0]) // x
write_coord(org[1]) // y
write_coord(org[2]) // z
write_byte(50) // radius
write_byte(c1) // r
write_byte(c2) // g
write_byte(c3) // b
write_byte(2) // life
write_byte(0) // decay rate
message_end()
continue;
}
else if(NightVisionMode[iPlayer] == 2)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, .player = iPlayer)
write_short(0) // duration
write_short(0) // hold time
write_short(0x0004) // fade type
write_byte(c1)
write_byte(c2)
write_byte(c3)
write_byte(70)
message_end()
set_player_light(iPlayer, "z")
if(!remove_task(id+100))
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, .player = iPlayer)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(c1)
write_byte(c2)
write_byte(c3)
write_byte(70)
message_end()
set_player_light(iPlayer, "z")
continue;
}
else if(NightVisionMode[iPlayer] == 3)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, .player = iPlayer)
write_short(0) // duration
write_short(0) // hold time
write_short(0x0004) // fade type
write_byte(c1)
write_byte(c2)
write_byte(c3)
write_byte(70)
message_end()
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, .player = iPlayer)
write_byte(TE_DLIGHT) // TE id
write_coord(org[0]) // x
write_coord(org[1]) // y
write_coord(org[2]) // z
write_byte(15) // radius
write_byte(c1) // r
write_byte(c2) // g
write_byte(c3) // b
write_byte(2) // life
write_byte(0) // decay rate
message_end()
continue;
}
}
}
stock set_player_light(id, const LightStyle[])
{
message_begin(MSG_ONE, SVC_LIGHTSTYLE, .player = id)
write_byte(0)
write_string(LightStyle)
message_end()
}