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

ingame map voting event ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jaylow
Junior Member
Join Date: Dec 2021
Old 01-18-2022 , 06:26   ingame map voting event ?
Reply With Quote #1

I am after an event which will fire when a map vote has been successful?

Like something like this

i need it to specifically only get the in game map votes that have been successful

PHP Code:

public void OnPluginStart()
{
    
HookEvent("map_vote_passed"VotePassed);
        
// I know there is a vote passed event (HookEvent("vote_passed", VotePassed);)
}


public 
Action VotePassed(Event event, const char[] sNamebool bDontBradcast)
{

        
PrintToChatAll("Map vote has been succesfull");


Jaylow is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-18-2022 , 11:33   Re: ingame map voting event ?
Reply With Quote #2

There are many HL2 game mods.
Tell us, which game ?

*edit
You can also search from *.res files, called:
.../resource/modevents.res
../resource/serverevents.res
../resource/gameevents.res

Last edited by Bacardi; 01-18-2022 at 11:37.
Bacardi is offline
Jaylow
Junior Member
Join Date: Dec 2021
Old 01-18-2022 , 19:31   Re: ingame map voting event ?
Reply With Quote #3

L4d2 ingame start new campaign voting
Jaylow is offline
Jaylow
Junior Member
Join Date: Dec 2021
Old 01-19-2022 , 00:12   Re: ingame map voting event ?
Reply With Quote #4

Why arent any of the voting events working?
Jaylow is offline
Jaylow
Junior Member
Join Date: Dec 2021
Old 01-19-2022 , 00:40   Re: ingame map voting event ?
Reply With Quote #5

did they disable all of these

39 vote_ended
40 vote_started
41 vote_changed
42 vote_passed
43 vote_failed
44 vote_cast_yes
45 vote_cast_no
Jaylow is offline
BeepIsla
Member
Join Date: Mar 2020
Location: Germany
Old 01-19-2022 , 06:44   Re: ingame map voting event ?
Reply With Quote #6

I am not familiar with L4D2 but can't you just listen to the "VoteStart", "VotePass" and "VoteFail" user messages? Not events.

Last edited by BeepIsla; 01-19-2022 at 06:44.
BeepIsla is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 01-19-2022 , 08:37   Re: ingame map voting event ?
Reply With Quote #7

Quote:
Originally Posted by Jaylow View Post
did they disable all of these

39 vote_ended
40 vote_started
41 vote_changed
42 vote_passed
43 vote_failed
44 vote_cast_yes
45 vote_cast_no
Tested l4d1/2 both game

Vote events are still working in l4d1, while l4d2 not
PHP Code:
    HookEvent("vote_started"EventVoteStart);
    
HookEvent("vote_passed"EventVoteEnd);
    
HookEvent("vote_failed"EventVoteEnd); 
Quote:
Originally Posted by BeepIsla View Post
I am not familiar with L4D2 but can't you just listen to the "VoteStart", "VotePass" and "VoteFail" user messages? Not events.
Didn't work, I have tried.
PHP Code:
    HookUserMessage(GetUserMessageId("VoteStart"), MsgVoteStart);
    
HookUserMessage(GetUserMessageId("VotePass"), MsgVotePass);
    
HookUserMessage(GetUserMessageId("VoteFail"), MsgVoteFail); 


Conclusion: In l4d2, use "callvote" and "vote" to track vote progress, and create fake event or fake Message
PHP Code:
    AddCommandListener(VoteStart"callvote"); //someone starts a vote
    
AddCommandListener(VoteAction"vote"); //someone votes yes or no 
These plugins are good examples.
votemanager2
PHP Code:
        new Handle:voteEvent CreateEvent("vote_started"); //fake event 

[L4D2] Vote Manager 3
PHP Code:
        new Handle:bf StartMessage("VoteFail"playersnumPlayersUSERMSG_RELIABLE); // create UserMessage 
__________________

Last edited by HarryPotter; 01-19-2022 at 08:42.
HarryPotter is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-23-2022 , 10:42   Re: ingame map voting event ?
Reply With Quote #8

HarryPotter, interesting. Nice tests!

I just want to remind, there is nice tool [ANY] UserMsg Hooks - DevTools, allowing to listen for all user messages for dev purposes.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 01-23-2022 at 10:45.
Dragokas is offline
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 03:08.


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