Raised This Month: $51 Target: $400
 12% 

Solved register_event ResetHUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-30-2018 , 14:48   register_event ResetHUD
Reply With Quote #1

hello, I want to hook ResetHUD event, but the problem is the parameters. How can I find out about the quantity of parameters the function will have and which one will be what?

I want to use the callback function to display the hud message that was initially reset by this event. Is it safe to make this function display hud messages individually to every client, which the event was sent to, or should I make them global - 0, which to my understanding would give the server under more load. I meant show_hudmessage(id, text) and show_hudmessage(0, text) respectively.

edit..
the strings would be formated in the function which is triggered by the event. So perhaps there is a way to filter out these messages?
__________________
retired chump

Last edited by DjSoftero; 01-31-2018 at 12:40.
DjSoftero is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-30-2018 , 15:16   Re: register_event ResetHUD
Reply With Quote #2

https://wiki.alliedmods.net/Half-lif...vents#ResetHUD
__________________
HamletEagle is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-31-2018 , 12:39   Re: register_event ResetHUD
Reply With Quote #3

This didn't explain everything, but I guess I can always test things out myself. Thank you. Thread solved
__________________
retired chump
DjSoftero is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-31-2018 , 15:54   Re: register_event ResetHUD
Reply With Quote #4

Quote:
hello, I want to hook ResetHUD event, but the problem is the parameters. How can I find out about the quantity of parameters the function will have and which one will be what?
The message has no parameters and the link I gave tells exactly that. Isn't this what you are asking for? Your OP is pretty confusing, at least for me. Maybe try explaining again if you want a better answer.
__________________

Last edited by HamletEagle; 01-31-2018 at 15:55.
HamletEagle is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-01-2018 , 03:08   Re: register_event ResetHUD
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
The message has no parameters and the link I gave tells exactly that. Isn't this what you are asking for? Your OP is pretty confusing, at least for me. Maybe try explaining again if you want a better answer.
Well, here: https://forums.alliedmods.net/archiv...p/t-42159.html is a code
PHP Code:
public plugin_init() {
        
register_event("ResetHUD""fwEvResetHUD""b")
}
 
public 
fwEvResetHUD(iPlayerId) {
        if (!
is_user_alive(iPlayerId))
                return
 
        if (
g_bPlayerNonSpawnEvent[iPlayerId]) {
                
g_bPlayerNonSpawnEvent[iPlayerId] = false
                
return
        }
        
fwPlayerSpawn(iPlayerId)

I was wondering how he got the IPlayerId parameter. I guess its from flag b, but then, maybe you can use a flag for global event? But the wiki says, that flags only help filter out the messages.
__________________
retired chump

Last edited by DjSoftero; 02-01-2018 at 12:39.
DjSoftero is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-01-2018 , 09:17   Re: register_event ResetHUD
Reply With Quote #6

Flag b is MSG_ONE
Flag a is MSG_ALL/MSG_BROADCAST

ResetHUD msg is sent for all connected players 1 by 1
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-01-2018 at 09:18.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 02:38.


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