Raised This Month: $ Target: $400
 0% 

[L4D,L4D2,TF2,CSGO] NativeVotes (v0.8.3, 2014-10-16)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ChoclatePancake
Junior Member
Join Date: Sep 2009
Old 12-29-2016 , 12:05   Re: [L4D,L4D2,TF2,CSGO] NativeVotes (v0.8.3, 2014-10-16)
Reply With Quote #11

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?

Last edited by ChoclatePancake; 12-29-2016 at 12:10.
ChoclatePancake is offline
 



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 23:37.


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