Raised This Month: $ Target: $400
 0% 

Hud Message Dissapear without any error in console


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Master Of Sad Codes
New Member
Join Date: May 2021
Old 05-01-2021 , 21:18   Hud Message Dissapear without any error in console
Reply With Quote #1

Hello boys i have a big problem.

This is how my hud message appear:

Code:
public fwd_PlayerSpawn(id)
{
	if( is_user_alive(id) )
		return;
	
	g_kills[id] = 0
	remove_task( TASK_SHOW_LEVEL + id );	

	set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
}


public HudsManaging(id)
{
        if(NormalHud[id])
        {
	set_hudmessage(0, 255, 255, 0.02, 0.33, 0, 0.0, 0.3, 0.0, 0.0)
	ShowSyncHudMsg(id, g_msgHudSync1, "%L", LANG_SERVER, "LEVEL_HUD_TEXT", PlayerLevel[id], PlayerXp[id], LEVELS[PlayerLevel[id]], RANK[PlayerLevel[id]], RANKLEVELS[PlayerLevel[id]])
        }
        if(OffHud[id])
        {
        NormalHud[id] = 0
        RedHud[id] = 0
        CC_SendMessage(id, "&x04[Hud] &x01Hud message disabled.")
        return PLUGIN_HANDLED
        }
        if(RedHud[id])
        {
        NormalHud[id] = 0
        OffHud[id] = 0
	set_hudmessage(255, 0, 0, 0.02, 0.33, 0, 0.0, 0.3, 0.0, 0.0)
	show_hudmessage(id, "[Level : %i] [XP : %i / %i]^n[Gun Level : %s]^n[Rank : %s]", PlayerLevel[id], PlayerXp[id], LEVELS[PlayerLevel[id]], RANK[PlayerLevel[id]], RANKLEVELS[PlayerLevel[id]])
        }
        if(OffHud[id])
        {
        NormalHud[id] = 0
        RedHud[id] = 0
	set_hudmessage(0, 0, 0, 0.00, 0.00, 0, 0.0, 0.0, 0.0, 0.0)
	show_hudmessage(id, "")
        }
        if(YellowHud[id])
        {
        NormalHud[id] = 0
        OffHud[id] = 0
        RedHud[id] = 0
	set_hudmessage(255, 255, 0, 0.02, 0.33, 0, 0.0, 0.3, 0.0, 0.0)
	show_hudmessage(id, "[Level : %i] [XP : %i / %i]^n[Gun Level : %s]^n[Rank : %s]", PlayerLevel[id], PlayerXp[id], LEVELS[PlayerLevel[id]], RANK[PlayerLevel[id]], RANKLEVELS[PlayerLevel[id]])
        }
        if(RandomColor[id])
        {
        OffHud[id] = 0
        RedHud[id] = 0
        NormalHud[id] = 0
        YellowHud[id] = 0
	set_hudmessage(random(255), random(255), random(255), 0.02, 0.33, 0, 0.0, 0.3, 0.0, 0.0)
	show_hudmessage(id, "[Level : %i] [XP : %i / %i]^n[Gun Level : %s]^n[Rank : %s]", PlayerLevel[id], PlayerXp[id], LEVELS[PlayerLevel[id]], RANK[PlayerLevel[id]], RANKLEVELS[PlayerLevel[id]])
        }
        return PLUGIN_CONTINUE
}

public task_show_level(task)
{
	new id = task - TASK_SHOW_LEVEL
	
	if(!is_user_alive(id) && lvl_text)
		return;
   
        NormalHud[id] = 1
        HudsManaging(id)	

        if(NormalHud[id])
        {
	set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
        }
        if(RedHud[id])
        {
	set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
        }
        if(YellowHud[id])
        {
	set_task(0.1, "task_show_level", TASK_SHOW_LEVEL + id)
        }
        if(RandomColor[id])
        {
        set_task(0.3, "task_show_level", TASK_SHOW_LEVEL + id)
        }
}


public menu_handler(id, menu, item) 
{
if( item < 0 ) return PLUGIN_CONTINUE;
new cmd[3], access, callback;
menu_item_getinfo(menu, item, access, cmd,2,_,_, callback);
new Choise = str_to_num(cmd)
switch (Choise) {
case 1: {
set_normalhud(id)
cmdMenu(id)
}
case 2: {
set_redhud(id)
cmdMenu(id)
}

case 3: {
set_yellowhud(id)
cmdMenu(id)
}
case 4: {
set_randomcolor(id)
cmdMenu(id)
}
}
return PLUGIN_HANDLED;
}

and some natives to set hud from a menu
This is a video with it when worked good:
https://www.youtube.com/watch?v=lEu60zNSbeQ

I don't receive any error in console with debug and without debug like params or something like this but my hud message dissapear.

Does anyone can help me please?
I know use so much memory with my bla[id] = 1 and some other things that can be fixed ez but i want first fix this (
Im not pro at scripting.
This is in local host and in my server no works too.

Last edited by Master Of Sad Codes; 05-01-2021 at 21:40. Reason: i forgot smth
Master Of Sad Codes is offline
fingerprint
Junior Member
Join Date: Apr 2022
Old 04-07-2022 , 12:19   Re: Hud Message Dissapear without any error in console
Reply With Quote #2

Try this
Attached Files
File Type: sma Get Plugin or Get Source (xx.sma - 43 views - 3.5 KB)
fingerprint is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode