RSSy MYGO.pl Opublikowano Listopad 6, 2020 o 14:10 RSSy Udostępnij Opublikowano Listopad 6, 2020 o 14:10 TF2-Built-in-Vote-sm_nextmap-bug-fix This plugin does hooks 'vote success' user message and changes 'sm_nextmap' cvar by msg's value. Without this plugin, you can't use built-in vote mechanism because map changes to sm_nextmap convar no matter what people voted. I did a few tries only this 'indirect' way worked. So I post this plugin although it has a ugly and indirect way. I hope this will be helped to people, and if you know the way to fix this problem in right way, please reply to this thread and i would be very thankful to you. Link to my github repository: https://github.com/jobggun/Sourcemod...xtmap-bug-fix/ Easy access to my code: PHP Code: #include <sourcemod> #pragma semicolon 1 #pragma newdecls required ConVar g_CvarSmnextmap = null; public Plugin myinfo = { name = "TF2 Built-in Vote sm_nextmap bug fix", author = "Jobggun", description = "Making TF2 Built-in vote work well with sourcemod nextmap plugin", version = "1.0.0", url = "" }; public void OnPluginStart() { g_CvarSmnextmap = FindConVar("sm_nextmap"); HookUserMessage(GetUserMessageId("VotePass"), Hook_ChangeLevel, true); } public Action Hook_ChangeLevel(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init) { int team; char reason[256]; char map[256]; team = msg.ReadByte(); msg.ReadString(reason, sizeof(reason), false); msg.ReadString(map, sizeof(map), false); if(!StrEqual(reason, "#TF_vote_passed_changelevel", false)) { return Plugin_Continue; } g_CvarSmnextmap.SetString(map, false, true); return Plugin_Continue; } Link to my github repository: https://github.com/jobggun/Sourcemod...xtmap-bug-fix/ Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi