Raised This Month: $ Target: $400
 0% 

Wondering about a kindof hook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Misery
Senior Member
Join Date: Dec 2010
Old 06-16-2012 , 09:20   Wondering about a kindof hook
Reply With Quote #1

Hi,

Right now I'm maintaining lists within the plugin about
1- Spawnable players
2- Team ids of players, period (i.e. regardless if they're spawnable or not)

This is mostly because I use a lot of references for this list and it's just optimal to make this work this way, instead of recalculating the data from scratch each time my functions get called.

I'm currently hooking the TeamInfo message and update the list here. I've hooked TeamInfo using a Orpheu way instead of the standard AMXX way. It's more efficient...

But I'm wondering... I still have some sort of problems with the list of spawnable players.

Say a user joins a team, but just does not choose it's appearance. In this case he's stuck to be dead and cannot be spawned until he chooses his appearance.
I am wondering if there would be something I could hook in order to perfectly know, right right after he chooses his appearance, so I can update my lists instantly.

I would use this hook in conjunction with my TeamInfo hook and it would be perfect... Would have been wonderful if TeamInfo was called too just after the player chooses his appearance. But it's not the case (there would be no point either...).

Also, as a side question. Is there any function I could hook which would be called both when a player joins a team and when he chooses his team? It's most likely a dream, just wondering...
I thought about hooking CheckWinConditions since it's called on some team joins and recalculate from scratch things there, but it's definitely not called always... since when the time comes where FPlayerCanRespawn() ends, it's not called anymore on team joins...

Thanks!

Misery

Last edited by Misery; 06-16-2012 at 10:41.
Misery is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-16-2012 , 09:50   Re: Wondering about a kindof hook
Reply With Quote #2

Don't have the time to decompile atm, but to start, and since you use orpheu, you could take a look at HandleMenu_ChooseAppearance() and HandleMenu_ChooseTeam().
__________________
Arkshine is offline
Misery
Senior Member
Join Date: Dec 2010
Old 06-16-2012 , 14:00   Re: Wondering about a kindof hook
Reply With Quote #3

HandleMenu_ChooseAppearance actually works gret, it's called just after appearance choosing. It's perfect. Thanks Arkshine ^^

Still, I wanted to hear your opinion on that... What about hooking pfnClientUserInfoChanged()?
I would hook it and recalculate all the spawnable/team list from zero... could it be a reliable function to hook on for team changes or the m_iTeam in private data can potentially be changed without calling this function?
Just wondering...

Misery
Misery is offline
Old 06-17-2012, 12:54
Misery
This message has been deleted by ConnorMcLeod. Reason: rukes
Reply


Thread Tools
Display Modes

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 06:07.


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