hello. i have a csgo mod addons and i'm using a crosshair plugin which allows players to use custom crosshairs. the problem occurs when players are using default game crosshair, sometimes when i shoot freelook crosshair appear and dissapear (
https://imgur.com/B2rThnn).
this is how i "restart" the crosshair to the default one.
PHP Code:
#define HUD_HIDE_CROSS (1<<6)
#define HUD_DRAW_CROSS (1<<7)
public plugin_init()
{
iMsgCrosshair = get_user_msgid("Crosshair");
}
public HookCurWeapon2(id)
{
if(!is_user_connected(id) || !is_user_logged(id))
return PLUGIN_HANDLED;
if(ImlecKontrol[id][SeciliCrosshair] == -1)
{
Hide_NormalCrosshair(id, 0);
return PLUGIN_HANDLED;
}
new clip, ammo
new w = get_user_weapon(id, clip, ammo)
Msg_WeaponList(id,genel_bilgiler[ImlecKontrol[id][SeciliCrosshair]][2][0],silah_listesi[w][1][0],silah_listesi[w][2][0],silah_listesi[w][3][0],silah_listesi[w][4][0],silah_listesi[w][5][0],0,CSW_SHIELD,silah_listesi[w][8][0]);
Msg_SetFOV(id,DEFAULT_FOV-1);
ClearPlayerBit(g_bSomeBool, id);
SetPlayerBit(g_bSomeBool,id);
Msg_SetFOV(id,DEFAULT_FOV+ImlecKontrol[id][FovKontrol]);
return PLUGIN_CONTINUE
}
stock Hide_NormalCrosshair(id, flag)
{
if(flag == 1)
{
message_begin(MSG_ONE, g_msgHideWeapon, _, id);
write_byte(HUD_HIDE_CROSS);
message_end();
}
else
{
message_begin(MSG_ONE, g_msgHideWeapon, _, id);
write_byte(HUD_DRAW_CROSS);
message_end();
}
}
i played with message flags, but same problem.