ZP 5.0: Hud Info enable/disable Feb 13, 2023 22:15:20 GMT via mobile Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by ProGarD on Feb 13, 2023 22:15:20 GMT Hello zppv.boards!I have request.. is there anyway to turn off hud info, bcs I know there is so many players got so much lag bcs of dhudmessage so I wanna at least turn off hud info anytime you want by saying /hudoff /hudonIs this possible?
ZP 5.0: Hud Info enable/disable Feb 13, 2023 22:52:16 GMT via mobile ProGarD likes this Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by Abhinash ( Bboy NeO ) on Feb 13, 2023 22:52:16 GMT You can do that easily with an array Boolean.Create an array of boolean and set their default value to true.Hook client say and set the Boolean for player index.Before showing the hud just check if Boolean is set to true for the player index. If it is set show the hud else don't.
ZP 5.0: Hud Info enable/disable Feb 14, 2023 1:22:49 GMT via mobile Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by ProGarD on Feb 14, 2023 1:22:49 GMT alright, thank you for advice i will try my best and sharing it here
ZP 5.0: Hud Info enable/disable Feb 14, 2023 16:26:15 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by ProGarD on Feb 14, 2023 16:26:15 GMT Feb 13, 2023 22:52:16 GMT Abhinash ( Bboy NeO ) said:You can do that easily with an array Boolean.Create an array of boolean and set their default value to true.Hook client say and set the Boolean for player index.Before showing the hud just check if Boolean is set to true for the player index. If it is set show the hud else don't.----------------------------------------------------Im not really good at doing codes im trying to learn by watching other codes and this is what i have got so far it's actually work, I know it's messed up but its actually workSo thank you for pushing me to do that by myself +karma//----------------------new bool: ShowThisHud[33] register_clcmd( "say /hud", "Say_showhud" )public Say_showhud(id) { if( ShowThisHud[id] ) { ShowThisHud[id] = set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b") zp_colored_print( id, "Hud Info : Enable") return; } zp_colored_print( id, "Hud Info : Disable") ShowThisHud[id] = remove_task(id+TASK_SHOWHUD)}
ZP 5.0: Hud Info enable/disable Feb 14, 2023 18:07:57 GMT via mobile Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by Abhinash ( Bboy NeO ) on Feb 14, 2023 18:07:57 GMT Feb 14, 2023 16:26:15 GMT ProGarD said:Feb 13, 2023 22:52:16 GMT Abhinash ( Bboy NeO ) said:You can do that easily with an array Boolean.Create an array of boolean and set their default value to true.Hook client say and set the Boolean for player index.Before showing the hud just check if Boolean is set to true for the player index. If it is set show the hud else don't.----------------------------------------------------Im not really good at doing codes im trying to learn by watching other codes and this is what i have got so far it's actually work, I know it's messed up but its actually workSo thank you for pushing me to do that by myself +karma//----------------------new bool: ShowThisHud[33] register_clcmd( "say /hud", "Say_showhud" )public Say_showhud(id) { if( ShowThisHud[id] ) { ShowThisHud[id] = set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b") zp_colored_print( id, "Hud Info : Enable") return; } zp_colored_print( id, "Hud Info : Disable") ShowThisHud[id] = remove_task(id+TASK_SHOWHUD)}Remove all codes related to displaying the hud here in this hooked say command. Just let the Boolean part here.And add a check with the bool where you actually were showing the hud before editing here.You can also shorten the code here by using ternary expression like -g_bShowHud[id] ? g_bShowHud[id] = false : g_bShowHud[id] = trueAlso if you are learning to code, I would recommend you to start learning C++. It will help you build your programming foundation.
ZP 5.0: Hud Info enable/disable Feb 15, 2023 5:59:27 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by Gaspatcho on Feb 15, 2023 5:59:27 GMT Feb 14, 2023 18:07:57 GMT Abhinash ( Bboy NeO ) said:Feb 14, 2023 16:26:15 GMT ProGarD said:----------------------------------------------------Im not really good at doing codes im trying to learn by watching other codes and this is what i have got so far it's actually work, I know it's messed up but its actually workSo thank you for pushing me to do that by myself +karma//----------------------new bool: ShowThisHud[33] register_clcmd( "say /hud", "Say_showhud" )public Say_showhud(id) { if( ShowThisHud[id] ) { ShowThisHud[id] = set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b") zp_colored_print( id, "Hud Info : Enable") return; } zp_colored_print( id, "Hud Info : Disable") ShowThisHud[id] = remove_task(id+TASK_SHOWHUD)}Remove all codes related to displaying the hud here in this hooked say command. Just let the Boolean part here.And add a check with the bool where you actually were showing the hud before editing here.You can also shorten the code here by using ternary expression like -g_bShowHud[id] ? g_bShowHud[id] = false : g_bShowHud[id] = trueAlso if you are learning to code, I would recommend you to start learning C++. It will help you build your programming foundation.//Correction:public Say_showhud(id){ if( ShowThisHud[id] ) { ShowThisHud[id] = false zp_colored_print( id, "Hud Info : Enable") } else { zp_colored_print( id, "Hud Info : Disable") ShowThisHud[id] = true }}//in ShowHUD function add if(!ShowThisHud[id]) before ShowSyncHudMsg
ZP 5.0: Hud Info enable/disable Feb 15, 2023 21:21:15 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by ProGarD on Feb 15, 2023 21:21:15 GMT Feb 15, 2023 5:59:27 GMT Gaspatcho said:Feb 14, 2023 18:07:57 GMT Abhinash ( Bboy NeO ) said:Remove all codes related to displaying the hud here in this hooked say command. Just let the Boolean part here.And add a check with the bool where you actually were showing the hud before editing here.You can also shorten the code here by using ternary expression like -g_bShowHud[id] ? g_bShowHud[id] = false : g_bShowHud[id] = trueAlso if you are learning to code, I would recommend you to start learning C++. It will help you build your programming foundation.//Correction:public Say_showhud(id){ if( ShowThisHud[id] ) { ShowThisHud[id] = false zp_colored_print( id, "Hud Info : Enable") } else { zp_colored_print( id, "Hud Info : Disable") ShowThisHud[id] = true }}//in ShowHUD function add if(!ShowThisHud[id]) before ShowSyncHudMsg I did the same thing but for some reason its not working for me, the print showed up but nothing happenEdit: i was using "return;" instead "else"
ZP 5.0: Hud Info enable/disable Feb 16, 2023 5:43:39 GMT via mobile Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by Gaspatcho on Feb 16, 2023 5:43:39 GMT Show your showhud function