AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
|
02-09-2013
, 02:34
Re: [L4D,L4D2,TF2,CSGO] NativeVotes [Beta] (v0.60, 2013-02-08)
|
#2
|
RESERVED
(I'll be adding more developer stuff here)
Porting SourceMod votes to NativeVotes
Warning: L4D, L4D2, and CS:GO only support Yes/No votes at this time
NativeVotes has 2 general types of votes: Specific votes and Custom votes. Specific votes use the game's own vote phrase titles. Custom votes use a vote title provided by the developer. [b]As of NativeVotes 0.8.0, this phrase can be translated using the MenuAction_Display callback and the NativeVotes_RedrawVoteTitle.
These two categories are further divided into two categories: Yes/No and Multiple Choice. L4D and L4D2 only support Yes/No votes and the Add/Insert/Remove item methods will simply do nothing for them. As of this writing, Multiple Choice votes are not displaying correctly on CSGO.
NativeVotes_Create requires a vote type as its second argument. The valid vote types are:
PHP Code:
NativeVotesType_Custom_YesNo, /**< Yes/No, details are vote text. */ NativeVotesType_Custom_Mult, /**< TF2/CS:GO: Multiple-choice, details are vote text. */ NativeVotesType_ChgCampaign, /**< L4D/L4D2: Yes/No, details are campaign name */ NativeVotesType_ChgDifficulty, /**< L4D/L4D2: Yes/No, details are difficulty number in L4D/L4D2 */ NativeVotesType_ReturnToLobby, /**< L4D/L4D2: Yes/No, details are ignored */ NativeVotesType_AlltalkOn, /**< L4D2: Yes/No, details are ignored (handled internally by extension) */ NativeVotesType_AlltalkOff, /**< L4D2: Yes/No, details are ignored (handled internally by extension) */ NativeVotesType_Restart, /**< Yes/No, details are ignored */ NativeVotesType_Kick, /**< Yes/No, target is player userid, details are auto-set by target */ NativeVotesType_KickIdle, /**< TF2/CS:GO: Yes/No, target is player userid, details are auto-set by target */ NativeVotesType_KickScamming, /**< TF2/CS:GO: Yes/No, target is player userid, details are auto-set by target */ NativeVotesType_KickCheating, /**< TF2/CS:GO: Yes/No, target is player userid, details are auto-set by target */ NativeVotesType_ChgLevel, /**< Yes/No, details are level number in L4D/L4D2 or map name in TF2 */ NativeVotesType_NextLevel, /**< TF2/CS:GO: Yes/No, details are map name */ NativeVotesType_NextLevelMult, /**< TF2/CS:GO: Multiple-choice, details are ignored */ NativeVotesType_ScrambleNow, /**< TF2/CS:GO: Yes/No, details are ignored */ NativeVotesType_ScrambleEnd, /**< TF2: Yes/No, details are ignored */ NativeVotesType_ChgMission, /**< TF2: Yes/No, details are popfile */ NativeVotesType_SwapTeams, /**< CS:GO: Yes/No, details are ignored */ NativeVotesType_Surrender, /**< CS:GO: Yes/No, details are ignored */ NativeVotesType_Rematch, /**< CS:GO: Yes/No, details are ignored */ NativeVotesType_Continue, /**< CS:GO: Yes/No, details are ignored */
You can find out if the current game supports a vote type using NativeVotes_IsVoteTypeSupported:
PHP Code:
if (NativeVotes_IsVoteTypeSupported(NativeVotesType_Custom_Mult))
Non-custom votes may require Details to display correctly. This can be set and retrieved using NativeVotes_SetDetails or NativeVotes_GetDetails.
__________________
Not currently working on SourceMod plugin development.
Last edited by Powerlord; 09-11-2013 at 10:40.
|
|