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

End of vote callback ? Hook check ?


Post New Thread Reply   
 
Thread Tools Display Modes
Furchee
Member
Join Date: Aug 2010
Old 12-11-2016 , 14:58   Re: End of vote callback ? Hook check ?
Reply With Quote #11

Quote:
Originally Posted by 8guawong View Post
show us
sm plugins list
Is there a way to achieve this with WITHOUT using MCE ?
I see what you're trying to make happen here but I'd rather use the default mapchooser.
Furchee is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-11-2016 , 20:06   Re: End of vote callback ? Hook check ?
Reply With Quote #12

Quote:
Originally Posted by Furchee View Post
Is there a way to achieve this with WITHOUT using MCE ?
I see what you're trying to make happen here but I'd rather use the default mapchooser.
Quote:
Originally Posted by Furchee View Post
I tried using his OnMapVoteEnd() but I couldn't get it to work (with the include file too, of course).

NICE, no more help from me
__________________
8guawong is offline
Furchee
Member
Join Date: Aug 2010
Old 12-11-2016 , 20:39   Re: End of vote callback ? Hook check ?
Reply With Quote #13

Quote:
Originally Posted by 8guawong View Post
NICE, no more help from me
I wasn't expecting the solution from you anyway.
Could someone else give me a response that actually helps ?
Furchee is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-11-2016 , 22:57   Re: End of vote callback ? Hook check ?
Reply With Quote #14

Quote:
Originally Posted by Furchee View Post
I wasn't expecting the solution from you anyway.
Could someone else give me a response that actually helps ?
good luck with your attitude and lies
__________________
8guawong is offline
Furchee
Member
Join Date: Aug 2010
Old 12-20-2016 , 20:28   Re: End of vote callback ? Hook check ?
Reply With Quote #15

Quote:
Originally Posted by 8guawong View Post
good luck with your attitude and lies
You're absolutely positively right. I've done nothing but lie to you this entire thread. If hearing that makes you feel better then I kindly ask you stop replying to this thread.

On another note, anyone know if this is possible WITHOUT using mapch extended ?
Furchee is offline
cra88y
AlliedModders Donor
Join Date: Dec 2016
Old 12-20-2016 , 22:45   Re: End of vote callback ? Hook check ?
Reply With Quote #16

Recompile your current mapchooser with your own hooks?
cra88y is offline
Furchee
Member
Join Date: Aug 2010
Old 01-04-2017 , 21:04   Re: End of vote callback ? Hook check ?
Reply With Quote #17

Quote:
Originally Posted by cra88y View Post
Recompile your current mapchooser with your own hooks?
I was thinking of doing this but I'd rather it was separate.
Do you think that's the only way ?
Furchee is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 01-05-2017 , 04:39   Re: End of vote callback ? Hook check ?
Reply With Quote #18

There is an event you can try hooking on to:

Code:
HookEvent("vote_ended", Event_VoteEnded);
According to the wiki it isn't implement, but that page was last edit 3 years ago so it doesn't hurt to try it out.

The other option is to HookUserMessage on to both "VotePass" and "VoteFailed".
__________________
Chaosxk is offline
Furchee
Member
Join Date: Aug 2010
Old 01-06-2017 , 20:29   Re: End of vote callback ? Hook check ?
Reply With Quote #19

Quote:
Originally Posted by Chaosxk View Post
There is an event you can try hooking on to:

Code:
HookEvent("vote_ended", Event_VoteEnded);
According to the wiki it isn't implement, but that page was last edit 3 years ago so it doesn't hurt to try it out.

The other option is to HookUserMessage on to both "VotePass" and "VoteFailed".
I've tried something such as this and it's failed to work.
Anything you think I could try past something like this ?

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "6.0"

public Plugin:myinfo 
{
    
name "Disable Chat During Map Vote",
    
author "CheeTah",
    
description "Who the fuck cares",
    
version PLUGIN_VERSION,
    
url "whatever.com"
};

public 
OnPluginStart()
{
    
HookEvent("vote_ended"Event_VoteEnded);
}

public 
Action:Event_VoteEnded(Handle:event, const String:name[], bool:dontBroadcast)
{
    
UnhookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
    
UnhookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
    
PrintToChatAll("-=[Chat Enabled (Map Vote Ended)]=-");
    return 
Plugin_Continue;
}

public 
OnMapVoteStarted()
{
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
HookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
HookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
}

public 
Action:usermessage(UserMsg:msg_idHandle:pbplayers[], playersNumbool:reliablebool:init)
{
return 
Plugin_Handled;


Last edited by Furchee; 01-06-2017 at 20:30.
Furchee is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 01-06-2017 , 21:29   Re: End of vote callback ? Hook check ?
Reply With Quote #20

Quote:
Originally Posted by Furchee View Post
I've tried something such as this and it's failed to work.
Anything you think I could try past something like this ?

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "6.0"

public Plugin:myinfo 
{
    
name "Disable Chat During Map Vote",
    
author "CheeTah",
    
description "Who the fuck cares",
    
version PLUGIN_VERSION,
    
url "whatever.com"
};

public 
OnPluginStart()
{
    
HookEvent("vote_ended"Event_VoteEnded);
}

public 
Action:Event_VoteEnded(Handle:event, const String:name[], bool:dontBroadcast)
{
    
UnhookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
    
UnhookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
    
PrintToChatAll("-=[Chat Enabled (Map Vote Ended)]=-");
    return 
Plugin_Continue;
}

public 
OnMapVoteStarted()
{
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
HookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
HookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
}

public 
Action:usermessage(UserMsg:msg_idHandle:pbplayers[], playersNumbool:reliablebool:init)
{
return 
Plugin_Handled;

If the vote_ended hook didn't work then it's probably because it was never fully implemented.

Try this, hooks on to VotePass and VoteFailed usermessage.

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "6.0"

public Plugin:myinfo 
{
    
name "Disable Chat During Map Vote",
    
author "CheeTah",
    
description "Who the fuck cares",
    
version PLUGIN_VERSION,
    
url "whatever.com"
};

public 
OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("VotePass"), OnVoteEndedtrue);
    
HookUserMessage(GetUserMessageId("VoteFailed"), OnVoteEndedtrue);
}

public 
OnMapVoteStarted()
{
    
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
    
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
    
PrintToChatAll("-=[Chat Disabled During Map Vote]=-");
    
HookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
    
HookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
}

public 
Action:usermessage(UserMsg:msg_idHandle:pbplayers[], playersNumbool:reliablebool:init)
{
    return 
Plugin_Handled;
}

public 
Action:OnVoteEnded(UserMsg:msg_idHandle:pbplayers[], playersNumbool:reliablebool:init)
{
    
UnhookUserMessage(GetUserMessageId("SayText"), usermessagetrue);
    
UnhookUserMessage(GetUserMessageId("SayText2"), usermessagetrue);
    
PrintToChatAll("-=[Chat Enabled (Map Vote Ended)]=-");

If this doesn't work the only real option is to add a forward to mapchooser itself.
__________________

Last edited by Chaosxk; 01-06-2017 at 21:32.
Chaosxk 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 14:47.


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