I want to use this with synergy's built in vote events
Code:
// SYNERGY
"vote_start"
{
"type" "short"
"token" "string"
"option" "string"
}
"vote_cast"
{
"user" "short"
"vote" "short"
}
"vote_end"
{
}
I am just wondering how to setup the functions for those events in votediagnostics.sp
since the vote event layout is so different compared to l4d2's (which i was looking at as a reference)
l4d's vote events
Code:
"vote_ended"
{
}
"vote_started"
{
"issue" "string"
"param1" "string"
"team" "byte"
"initiator" "long" // entity id of the player who initiated the vote
}
"vote_changed"
{
"yesVotes" "byte"
"noVotes" "byte"
"potentialVotes" "byte"
}
"vote_passed"
{
"details" "string"
"param1" "string"
"team" "byte"
}
"vote_failed"
{
"team" "byte"
}
"vote_cast_yes"
{
"team" "byte"
"entityid" "long" // entity id of the voter
}
"vote_cast_no"
{
"team" "byte"
"entityid" "long" // entity id of the voter
}
example of the l4d2 functions im talking about in votediagnostics
Code:
public Action:L4D2_MessageVoteStart(UserMsg:msg_id, Handle:message, const players[], playersNum, bool:reliable, bool:init)
{
new String:issue[MAX_ARG_SIZE];
new String:param1[MAX_ARG_SIZE];
new String:initiatorName[MAX_NAME_LENGTH];
new team = BfReadByte(message);
new initiator = BfReadByte(message);
BfReadString(message, issue, MAX_ARG_SIZE);
BfReadString(message, param1, MAX_ARG_SIZE);
BfReadString(message, initiatorName, MAX_NAME_LENGTH);
LogToFile(LOGFILE, "VoteStart Usermessage: team: %d, initiator: %d, issue: %s, param1: %s, player count: %d, initiatorName: %s", team, initiator, issue, param1, playersNum, initiatorName);
if (CheckVoteController())
{
LogToFile(LOGFILE, "Active Index for issue %s: %d", issue, GetEntProp(g_VoteController, Prop_Send, "m_activeIssueIndex"));
}
return Plugin_Continue;
}
(these functions get setup here btw)
Code:
public OnPluginStart()
{
switch (g_EngineVersion)
{
case Engine_Left4Dead2:
{
HookEventEx("vote_changed", L4DL4D2_EventVoteChanged);
HookUserMessage(GetUserMessageId("VoteRegistered"), L4DL4D2_MessageVoteRegistered);
HookUserMessage(GetUserMessageId("VoteStart"), L4D2_MessageVoteStart);
HookUserMessage(GetUserMessageId("VotePass"), L4D2_MessageVotePass);
HookUserMessage(GetUserMessageId("VoteFail"), L4D2_MessageVoteFail);
HookUserMessage(GetUserMessageId("CallVoteFailed"), L4DL4D2_MessageCallVoteFailed);
}
how would i rewrite those functions for synergy's vote events?