hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.07. 17:48



Jelenlévő felhasználók

Jelenleg 353 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 353 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 9 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 16:47 
Offline
Fórum Moderátor
Avatar

Csatlakozott: 2012.07.02. 17:41
Hozzászólások: 1641
Megköszönt másnak: 121 alkalommal
Megköszönték neki: 247 alkalommal
Üdv, 1.8.3 mas fordítók sem akarják átalakítani
Hiba:
Kód:
adminvote.sma(46) : error 017: undefined symbol "MAX_NAME_LENGTH"
adminvote.sma(48) : error 009: invalid array size (negative or zero)
adminvote.sma(49) : error 017: undefined symbol "name"
adminvote.sma(49) : error 072: "sizeof" operator is invalid on "function" symbols
adminvote.sma(49) : error 029: invalid expression, assumed zero
adminvote.sma(49) : fatal error 107: too many error messages on one line


Ez miért van?

adminvote:
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4.  
  5. new g_Answer[128]
  6. new g_optionName[4][64]
  7. new g_voteCount[4]
  8. new g_validMaps
  9. new g_yesNoVote
  10. new g_coloredMenus
  11. new g_voteCaller
  12. new g_Execute[256]
  13. new g_execLen
  14.  
  15. new bool:g_execResult
  16. new Float:g_voteRatio
  17.  
  18. public plugin_init()
  19. {
  20.     register_plugin("Admin Votes", AMXX_VERSION_STR, "AMXX Dev Team")
  21.     register_dictionary("adminvote.txt")
  22.     register_dictionary("common.txt")
  23.     register_dictionary("mapsmenu.txt")
  24.     register_menucmd(register_menuid("Change map to "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  25.     register_menucmd(register_menuid("Choose map: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
  26.     register_menucmd(register_menuid("Kick "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  27.     register_menucmd(register_menuid("Ban "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  28.     register_menucmd(register_menuid("Vote: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
  29.     register_menucmd(register_menuid("The result: "), MENU_KEY_1|MENU_KEY_2, "actionResult")
  30.     register_concmd("amx_votemap", "cmdVoteMap", ADMIN_VOTE, "<map> [map] [map] [map]")
  31.     register_concmd("amx_votekick", "cmdVoteKickBan", ADMIN_VOTE, "<name or #userid>")
  32.     register_concmd("amx_voteban", "cmdVoteKickBan", ADMIN_VOTE, "<name or #userid>")
  33.     register_concmd("amx_vote", "cmdVote", ADMIN_VOTE, "<question> <answer#1> <answer#2>")
  34.     register_concmd("amx_cancelvote", "cmdCancelVote", ADMIN_VOTE, "- cancels last vote")
  35.    
  36.     g_coloredMenus = colored_menus()
  37. }
  38.  
  39. public cmdCancelVote(id, level, cid)
  40. {
  41.     if (!cmd_access(id, level, cid, 0))
  42.         return PLUGIN_HANDLED
  43.  
  44.     if (task_exists(99889988, 1))
  45.     {
  46.         new authid[32], name[MAX_NAME_LENGTH]
  47.        
  48.         get_user_authid(id, authid, charsmax(authid))
  49.         get_user_name(id, name, charsmax(name))
  50.         log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
  51.    
  52.         new msg[256];
  53.         for (new i = 1; i <= MaxClients; i++)
  54.         {
  55.             if (is_user_connected(i) && !is_user_bot(i))
  56.             {
  57.                 // HACK: ADMIN_CANC_VOTE_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  58.                 LookupLangKey(msg, charsmax(msg), "ADMIN_CANC_VOTE_1", i);
  59.                 replace_all(msg, charsmax(msg), "%s", "");
  60.                 replace_all(msg, charsmax(msg), ":", "");
  61.                 trim(msg);
  62.                 show_activity_id(i, id, name, msg);
  63.             }
  64.         }
  65.        
  66.         console_print(id, "%L", id, "VOTING_CANC")
  67.         client_print(0,print_chat,"%L",LANG_PLAYER,"VOTING_CANC")
  68.         remove_task(99889988, 1)
  69.         set_cvar_float("amx_last_voting", get_gametime())
  70.     }
  71.     else
  72.         console_print(id, "%L", id, "NO_VOTE_CANC")
  73.  
  74.     return PLUGIN_HANDLED
  75. }
  76.  
  77. public delayedExec(cmd[])
  78.     server_cmd("%s", cmd)
  79.  
  80. public autoRefuse()
  81. {
  82.     log_amx("Vote: %L", "en", "RES_REF")
  83.     client_print(0, print_chat, "%L", LANG_PLAYER, "RES_REF")
  84. }
  85.  
  86. public actionResult(id, key)
  87. {
  88.     remove_task(4545454)
  89.    
  90.     switch (key)
  91.     {
  92.         case 0:
  93.         {
  94.             set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
  95.             log_amx("Vote: %L", "en", "RES_ACCEPTED")
  96.             client_print(0, print_chat, "%L", LANG_PLAYER, "RES_ACCEPTED")
  97.         }
  98.         case 1: autoRefuse()
  99.     }
  100.    
  101.     return PLUGIN_HANDLED
  102. }
  103.  
  104. public checkVotes()
  105. {
  106.     new best = 0
  107.    
  108.     if (!g_yesNoVote)
  109.     {
  110.         for (new a = 0; a < 4; ++a)
  111.             if (g_voteCount[a] > g_voteCount[best])
  112.        
  113.         best = a
  114.     }
  115.  
  116.     new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3]
  117.     new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
  118.     new iResult = g_voteCount[best]
  119.     new players[MAX_PLAYERS], pnum, i
  120.    
  121.     get_players(players, pnum, "c")
  122.    
  123.     if (iResult < iRatio)
  124.     {
  125.         new lVotingFailed[64]
  126.        
  127.         for (i = 0; i < pnum; i++)
  128.         {
  129.             format(lVotingFailed, 63, "%L", players[i], "VOTING_FAILED")
  130.             if (g_yesNoVote)
  131.                 client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio)
  132.             else
  133.                 client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_2", lVotingFailed, iResult, iRatio)
  134.         }
  135.        
  136.         format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED")
  137.         log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio)
  138.        
  139.         return PLUGIN_CONTINUE
  140.     }
  141.  
  142.     g_execLen = format(g_Execute, charsmax(g_Execute), g_Answer, g_optionName[best]) + 1
  143.    
  144.     if (g_execResult)
  145.     {
  146.         g_execResult = false
  147.        
  148.         if (is_user_connected(g_voteCaller))
  149.         {
  150.             new menuBody[512], lTheResult[32], lYes[16], lNo[16]
  151.            
  152.             format(lTheResult, charsmax(lTheResult), "%L", g_voteCaller, "THE_RESULT")
  153.             format(lYes, charsmax(lYes), "%L", g_voteCaller, "YES")
  154.             format(lNo, charsmax(lNo), "%L", g_voteCaller, "NO")
  155.            
  156.             new len = format(menuBody, charsmax(menuBody), g_coloredMenus ? "\y%s: \w%s^n^n" : "%s: %s^n^n", lTheResult, g_Execute)
  157.            
  158.             len += format(menuBody[len], charsmax(menuBody) - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
  159.             format(menuBody[len], charsmax(menuBody) - len, "^n1. %s^n2. %s", lYes, lNo)
  160.             show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ")
  161.             set_task(10.0, "autoRefuse", 4545454)
  162.         }
  163.         else
  164.             set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
  165.     }
  166.    
  167.     new lVotingSuccess[32]
  168.    
  169.     for (i = 0; i < pnum; i++)
  170.     {
  171.         format(lVotingSuccess, charsmax(lVotingSuccess), "%L", players[i], "VOTING_SUCCESS")
  172.         print_color(players[i], "%L", players[i], "VOTING_RES_3", lVotingSuccess, iResult, iRatio, g_Execute)
  173.     }
  174.    
  175.     format(lVotingSuccess, charsmax(lVotingSuccess), "%L", "en", "VOTING_SUCCESS")
  176.     log_amx("Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", lVotingSuccess, iResult, iRatio, g_Execute)
  177.    
  178.     return PLUGIN_CONTINUE
  179. }
  180.  
  181. public voteCount(id, key)
  182. {
  183.     if (get_cvar_num("amx_vote_answers"))
  184.     {
  185.         new name[MAX_NAME_LENGTH]
  186.         get_user_name(id, name, charsmax(name))
  187.        
  188.         if (g_yesNoVote)
  189.             print_color(0, "%L", LANG_PLAYER, key ? "VOTED_AGAINST" : "VOTED_FOR", name)
  190.         else
  191.             print_color(0, "%L", LANG_PLAYER, "VOTED_FOR_OPT", name, key + 1)
  192.     }
  193.     ++g_voteCount[key]
  194.    
  195.     return PLUGIN_HANDLED
  196. }
  197.  
  198. public cmdVoteMap(id, level, cid)
  199. {
  200.     if (!cmd_access(id, level, cid, 2))
  201.         return PLUGIN_HANDLED
  202.    
  203.     new Float:voting = get_cvar_float("amx_last_voting")
  204.     if (voting > get_gametime())
  205.     {
  206.         console_print(id, "%L", id, "ALREADY_VOTING")
  207.         return PLUGIN_HANDLED
  208.     }
  209.    
  210.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  211.     {
  212.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  213.         return PLUGIN_HANDLED
  214.     }
  215.  
  216.     new argc = read_argc()
  217.     if (argc > 5) argc = 5
  218.    
  219.     g_validMaps = 0
  220.     g_optionName[0][0] = 0
  221.     g_optionName[1][0] = 0
  222.     g_optionName[2][0] = 0
  223.     g_optionName[3][0] = 0
  224.    
  225.     for (new i = 1; i < argc; ++i)
  226.     {
  227.         read_argv(i, g_optionName[g_validMaps], 31)
  228.        
  229.         if (is_map_valid(g_optionName[g_validMaps]))
  230.             g_validMaps++
  231.     }
  232.    
  233.     if (g_validMaps == 0)
  234.     {
  235.         new lMaps[16]
  236.        
  237.         format(lMaps, charsmax(lMaps), "%L", id, (argc == 2) ? "MAP_IS" : "MAPS_ARE")
  238.         console_print(id, "%L", id, "GIVEN_NOT_VALID", lMaps)
  239.         return PLUGIN_HANDLED
  240.     }
  241.  
  242.     new menu_msg[256], len = 0
  243.     new keys = 0
  244.    
  245.     if (g_validMaps > 1)
  246.     {
  247.         keys = MENU_KEY_0
  248.         len = format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%L: \w^n^n" : "%L: ^n^n", LANG_SERVER, "CHOOSE_MAP")
  249.         new temp[128]
  250.        
  251.         for (new a = 0; a < g_validMaps; ++a)
  252.         {
  253.             format(temp, charsmax(temp), "%d.  %s^n", a+1, g_optionName[a])
  254.             len += copy(menu_msg[len], charsmax(menu_msg) - len, temp)
  255.             keys |= (1<<a)
  256.         }
  257.        
  258.         format(menu_msg[len], charsmax(menu_msg) - len, "^n0.  %L", LANG_SERVER, "NONE")
  259.         g_yesNoVote = 0
  260.     } else {
  261.         new lChangeMap[32], lYes[16], lNo[16]
  262.        
  263.         format(lChangeMap, charsmax(lChangeMap), "%L", LANG_SERVER, "CHANGE_MAP_TO")
  264.         format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES")
  265.         format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO")
  266.         format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lChangeMap, g_optionName[0], lYes, lNo)
  267.         keys = MENU_KEY_1|MENU_KEY_2
  268.         g_yesNoVote = 1
  269.     }
  270.    
  271.     new authid[32], name[MAX_NAME_LENGTH]
  272.    
  273.     get_user_authid(id, authid, charsmax(authid))
  274.     get_user_name(id, name, charsmax(name))
  275.    
  276.     if (argc == 2)
  277.         log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name, get_user_userid(id), authid, g_optionName[0])
  278.     else
  279.         log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3])
  280.  
  281.     new msg[256];
  282.     for (new i = 1; i <= MaxClients; i++)
  283.     {
  284.         if (is_user_connected(i) && !is_user_bot(i))
  285.         {
  286.             // HACK: ADMIN_VOTE_MAP_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  287.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_MAP_1", i);
  288.             replace_all(msg, charsmax(msg), "%s", "");
  289.             replace_all(msg, charsmax(msg), ":", "");
  290.             trim(msg);
  291.             show_activity_id(i, id, name, msg);
  292.         }
  293.     }
  294.  
  295.     g_execResult = true
  296.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  297.    
  298.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  299.     g_voteRatio = get_cvar_float("amx_votemap_ratio")
  300.     g_Answer = "changelevel %s"
  301.     show_menu(0, keys, menu_msg, floatround(vote_time), (g_validMaps > 1) ? "Choose map: " : "Change map to ")
  302.     set_task(vote_time, "checkVotes", 99889988)
  303.     g_voteCaller = id
  304.     console_print(id, "%L", id, "VOTING_STARTED")
  305.     g_voteCount = {0, 0, 0, 0}
  306.    
  307.     return PLUGIN_HANDLED
  308. }
  309.  
  310. public cmdVote(id, level, cid)
  311. {
  312.     if (!cmd_access(id, level, cid, 4))
  313.         return PLUGIN_HANDLED
  314.    
  315.     new Float:voting = get_cvar_float("amx_last_voting")
  316.     if (voting > get_gametime())
  317.     {
  318.         console_print(id, "%L", id, "ALREADY_VOTING")
  319.         return PLUGIN_HANDLED
  320.     }
  321.    
  322.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  323.     {
  324.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  325.         return PLUGIN_HANDLED
  326.     }
  327.  
  328.     new quest[48]
  329.     read_argv(1, quest, charsmax(quest))
  330.    
  331.     trim(quest);
  332.    
  333.     if (contain(quest, "sv_password") != -1 || contain(quest, "rcon_password") != -1)
  334.     {
  335.         console_print(id, "%L", id, "VOTING_FORBIDDEN")
  336.         return PLUGIN_HANDLED
  337.     }
  338.    
  339.     new count=read_argc();
  340.  
  341.     for (new i=0;i<4 && (i+2)<count;i++)
  342.     {
  343.         read_argv(i+2, g_optionName[i], charsmax(g_optionName[]));
  344.     }
  345.  
  346.     new authid[32], name[MAX_NAME_LENGTH]
  347.    
  348.     get_user_authid(id, authid, charsmax(authid))
  349.     get_user_name(id, name, charsmax(name))
  350.     log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1])
  351.  
  352.     new msg[256];
  353.     for (new i = 1; i <= MaxClients; i++)
  354.     {
  355.         if (is_user_connected(i) && !is_user_bot(i))
  356.         {
  357.             // HACK: ADMIN_VOTE_CUS_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  358.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_CUS_1", i);
  359.             replace_all(msg, charsmax(msg), "%s", "");
  360.             replace_all(msg, charsmax(msg), ":", "");
  361.             trim(msg);
  362.             show_activity_id(i, id, name, msg);
  363.         }
  364.     }
  365.  
  366.     new menu_msg[512], lVote[16]
  367.    
  368.     format(lVote, charsmax(lVote), "%L", LANG_SERVER, "VOTE")
  369.    
  370.     count-=2;
  371.     if (count>4)
  372.     {
  373.         count=4;
  374.     }
  375.     // count now shows how many options were listed
  376.     new keys=0;
  377.     for (new i=0;i<count;i++)
  378.     {
  379.         keys |= (1<<i);
  380.     }
  381.    
  382.     new len=formatex(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s: %s\w^n^n" : "%s: %s^n^n", lVote, quest);
  383.    
  384.     for (new i=0;i<count;i++)
  385.     {
  386.         len+=formatex(menu_msg[len], charsmax(menu_msg) - len ,"%d.  %s^n",i+1,g_optionName[i]);
  387.     }
  388.     g_execResult = false
  389.    
  390.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  391.    
  392.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  393.     g_voteRatio = get_cvar_float("amx_vote_ratio")
  394.     replace_all(quest, charsmax(quest), "%", "");
  395.     format(g_Answer, charsmax(g_Answer), "%s - %%s", quest)
  396.     show_menu(0, keys, menu_msg, floatround(vote_time), "Vote: ")
  397.     set_task(vote_time, "checkVotes", 99889988)
  398.     g_voteCaller = id
  399.     console_print(id, "%L", id, "VOTING_STARTED")
  400.     g_voteCount = {0, 0, 0, 0}
  401.     g_yesNoVote = 0
  402.    
  403.     return PLUGIN_HANDLED
  404. }
  405.  
  406. public cmdVoteKickBan(id, level, cid)
  407. {
  408.     if (!cmd_access(id, level, cid, 2))
  409.         return PLUGIN_HANDLED
  410.    
  411.     new Float:voting = get_cvar_float("amx_last_voting")
  412.     if (voting > get_gametime())
  413.     {
  414.         console_print(id, "%L", id, "ALREADY_VOTING")
  415.         return PLUGIN_HANDLED
  416.     }
  417.  
  418.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  419.     {
  420.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  421.         return PLUGIN_HANDLED
  422.     }
  423.  
  424.     new cmd[32]
  425.    
  426.     read_argv(0, cmd, charsmax(cmd))
  427.    
  428.     new voteban = equal(cmd, "amx_voteban")
  429.     new arg[32]
  430.     read_argv(1, arg, charsmax(arg))
  431.    
  432.     new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
  433.    
  434.     if (!player)
  435.         return PLUGIN_HANDLED
  436.    
  437.     if (voteban && is_user_bot(player))
  438.     {
  439.         new imname[MAX_NAME_LENGTH]
  440.        
  441.         get_user_name(player, imname, charsmax(imname))
  442.         console_print(id, "%L", id, "ACTION_PERFORMED", imname)
  443.         return PLUGIN_HANDLED
  444.     }
  445.  
  446.     new keys = MENU_KEY_1|MENU_KEY_2
  447.     new menu_msg[256], lYes[16], lNo[16], lKickBan[16]
  448.    
  449.     format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES")
  450.     format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO")
  451.     format(lKickBan, charsmax(lKickBan), "%L", LANG_SERVER, voteban ? "BAN" : "KICK")
  452.     ucfirst(lKickBan)
  453.     get_user_name(player, arg, charsmax(arg))
  454.     format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lKickBan, arg, lYes, lNo)
  455.     g_yesNoVote = 1
  456.    
  457.     new bool:ipban=false;
  458.    
  459.     if (voteban)
  460.     {
  461.         get_user_authid(player, g_optionName[0], charsmax(g_optionName[]));
  462.        
  463.         // Do the same check that's in plmenu to determine if this should be an IP ban instead
  464.         if (equal("4294967295", g_optionName[0])
  465.             || equal("HLTV", g_optionName[0])
  466.             || equal("STEAM_ID_LAN", g_optionName[0])
  467.             || equali("VALVE_ID_LAN", g_optionName[0]))
  468.         {
  469.             get_user_ip(player, g_optionName[0], charsmax(g_optionName[]), 1);
  470.            
  471.             ipban=true;
  472.         }
  473.  
  474.     }
  475.     else
  476.     {
  477.         num_to_str(get_user_userid(player), g_optionName[0], charsmax(g_optionName[]))
  478.     }
  479.    
  480.     new authid[32], name[MAX_NAME_LENGTH]
  481.    
  482.     get_user_authid(id, authid, charsmax(authid))
  483.     get_user_name(id, name, charsmax(name))
  484.     log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg)
  485.  
  486.     new msg[256];
  487.     new right[256];
  488.     new dummy[1];
  489.     for (new i = 1; i <= MaxClients; i++)
  490.     {
  491.         if (is_user_connected(i) && !is_user_bot(i))
  492.         {
  493.             formatex(lKickBan, charsmax(lKickBan), "%L", i, voteban ? "BAN" : "KICK");
  494.            
  495.             // HACK: ADMIN_VOTE_FOR{1,2} keys are really weird.  Tokenize and ignore the text before the :
  496.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_FOR_1", i);
  497.             strtok(msg, dummy, 0, right, charsmax(right), ':');
  498.             trim(right);
  499.             show_activity_id(i, id, name, right, lKickBan, arg);
  500.         }
  501.     }
  502.  
  503.     g_execResult = true
  504.    
  505.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  506.    
  507.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  508.     g_voteRatio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio")
  509.  
  510.     if (voteban)
  511.     {
  512.         if (ipban==true)
  513.         {
  514.             g_Answer = "addip 30.0 %s";
  515.         }
  516.         else
  517.         {
  518.             g_Answer = "banid 30.0 %s kick";
  519.  
  520.         }
  521.     }
  522.     else
  523.     {
  524.         g_Answer = "kick #%s";
  525.     }
  526.     show_menu(0, keys, menu_msg, floatround(vote_time), voteban ? "Ban " : "Kick ")
  527.     set_task(vote_time, "checkVotes", 99889988)
  528.     g_voteCaller = id
  529.     console_print(id, "%L", id, "VOTING_STARTED")
  530.     g_voteCount = {0, 0, 0, 0}
  531.    
  532.     return PLUGIN_HANDLED
  533. }
  534.  
  535. stock print_color(const id, const input[], any:...)
  536. {
  537.         new count = 1, players[32]
  538.         static msg[191]
  539.         vformat(msg, 190, input, 3)
  540.  
  541.         replace_all(msg, 190, "!g", "^4")
  542.         replace_all(msg, 190, "!y", "^1")
  543.         replace_all(msg, 190, "!t", "^3")
  544.         replace_all(msg, 190, "á", "á")
  545.         replace_all(msg, 190, "é", "Ă©")
  546.         replace_all(msg, 190, "í", "Ă­")
  547.         replace_all(msg, 190, "ó", "Ăł")
  548.         replace_all(msg, 190, "ö", "ö")
  549.         replace_all(msg, 190, "ő", "Ĺ‘")
  550.         replace_all(msg, 190, "ú", "Ăş")
  551.         replace_all(msg, 190, "ü", "ĂĽ")
  552.         replace_all(msg, 190, "ű", "ű")
  553.         replace_all(msg, 190, "Á", "Á")
  554.         replace_all(msg, 190, "É", "É")
  555.         replace_all(msg, 190, "Í", "ĂŤ")
  556.         replace_all(msg, 190, "Ó", "Ă“")
  557.         replace_all(msg, 190, "Ö", "Ă–")
  558.         replace_all(msg, 190, "Ő", "Ő")
  559.         replace_all(msg, 190, "Ú", "Ăš")
  560.         replace_all(msg, 190, "Ü", "Ăś")
  561.         replace_all(msg, 190, "Ű", "Ĺ°")        
  562.  
  563.         if (id) players[0] = id; else get_players(players, count, "ch")
  564.         {
  565.                 for (new i = 0; i < count; i++)
  566.                 {
  567.                         if (is_user_connected(players[i]))
  568.                         {
  569.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  570.                                 write_byte(players[i])
  571.                                 write_string(msg)
  572.                                 message_end()
  573.                         }
  574.                 }
  575.         }
  576.         return PLUGIN_HANDLED
  577. }

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 16:52 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7962
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 535 alkalommal
MAX_NAME_LENGTH nincs definálva.

Ez az 1.8.3-as plugin? 1.8.3as fordítóval próbálod? Illetve az includek is 1.8.3-asok?

Szerintem az includek nem lettek kicserélve és az a gond. De amúgy ha plugin elején definálod az sem para, bár globálisan egyszerűbb megoldani a problémát, hogy többet ne forduljon elő.

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:15 
Offline
Fórum Moderátor
Avatar

Csatlakozott: 2012.07.02. 17:41
Hozzászólások: 1641
Megköszönt másnak: 121 alkalommal
Megköszönték neki: 247 alkalommal
kiki írta:
MAX_NAME_LENGTH nincs definálva.

Ez az 1.8.3-as plugin? 1.8.3as fordítóval próbálod? Illetve az includek is 1.8.3-asok?

Szerintem az includek nem lettek kicserélve és az a gond. De amúgy ha plugin elején definálod az sem para, bár globálisan egyszerűbb megoldani a problémát, hogy többet ne forduljon elő.

https://amx.freakz.ro/ - http://aghl.ru/webcompiler/ - ki vannak cserélve az includek, de úgy sem jó :/

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:19 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2014.09.08. 22:21
Hozzászólások: 3014
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 555 alkalommal
undefined symbol "MAX_NAME_LENGTH

ez 100%, hogy nem 1.8.3-mas amúgy meg local compiler, azt nem kell ilyennel bajlódni.

_________________
GitHub - mforce


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:23 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7962
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 535 alkalommal
Na - Ja, én sem ajánlom az online fordítókat.

Off Topic
Így hogy az aghl.ru lefrissítette a compilerjét, így az oldalon egy rakat plugint nem fog gondolom innentől kezdve lefordítani. Mert a jóváhagyott pluginokat is az aghl.ru-n fordítja.

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:28 
Offline
Fórum Moderátor
Avatar

Csatlakozott: 2012.07.02. 17:41
Hozzászólások: 1641
Megköszönt másnak: 121 alkalommal
Megköszönték neki: 247 alkalommal
Így fordítja
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define MAX_NAME_LENGTH 32
  5. #define MAX_PLAYERS 32
  6.  
  7. new g_Answer[128]
  8. new g_optionName[4][64]
  9. new g_voteCount[4]
  10. new g_validMaps
  11. new g_yesNoVote
  12. new g_coloredMenus
  13. new g_voteCaller
  14. new g_Execute[256]
  15. new g_execLen
  16.  
  17. new bool:g_execResult
  18. new Float:g_voteRatio
  19.  
  20. public plugin_init()
  21. {
  22.     register_plugin("Admin Votes", AMXX_VERSION_STR, "AMXX Dev Team")
  23.     register_dictionary("adminvote.txt")
  24.     register_dictionary("common.txt")
  25.     register_dictionary("mapsmenu.txt")
  26.     register_menucmd(register_menuid("Change map to "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  27.     register_menucmd(register_menuid("Choose map: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
  28.     register_menucmd(register_menuid("Kick "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  29.     register_menucmd(register_menuid("Ban "), MENU_KEY_1|MENU_KEY_2, "voteCount")
  30.     register_menucmd(register_menuid("Vote: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
  31.     register_menucmd(register_menuid("The result: "), MENU_KEY_1|MENU_KEY_2, "actionResult")
  32.     register_concmd("amx_votemap", "cmdVoteMap", ADMIN_VOTE, "<map> [map] [map] [map]")
  33.     register_concmd("amx_votekick", "cmdVoteKickBan", ADMIN_VOTE, "<name or #userid>")
  34.     register_concmd("amx_voteban", "cmdVoteKickBan", ADMIN_VOTE, "<name or #userid>")
  35.     register_concmd("amx_vote", "cmdVote", ADMIN_VOTE, "<question> <answer#1> <answer#2>")
  36.     register_concmd("amx_cancelvote", "cmdCancelVote", ADMIN_VOTE, "- cancels last vote")
  37.    
  38.     g_coloredMenus = colored_menus()
  39. }
  40.  
  41. public stock const MaxClients;
  42.  
  43. public cmdCancelVote(id, level, cid)
  44. {
  45.     if (!cmd_access(id, level, cid, 0))
  46.         return PLUGIN_HANDLED
  47.  
  48.     if (task_exists(99889988, 1))
  49.     {
  50.         new authid[32], name[MAX_NAME_LENGTH]
  51.        
  52.         get_user_authid(id, authid, charsmax(authid))
  53.         get_user_name(id, name, charsmax(name))
  54.         log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
  55.    
  56.         new msg[256];
  57.         for (new i = 1; i <= MaxClients; i++)
  58.         {
  59.             if (is_user_connected(i) && !is_user_bot(i))
  60.             {
  61.                 // HACK: ADMIN_CANC_VOTE_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  62.                 LookupLangKey(msg, charsmax(msg), "ADMIN_CANC_VOTE_1", i);
  63.                 replace_all(msg, charsmax(msg), "%s", "");
  64.                 replace_all(msg, charsmax(msg), ":", "");
  65.                 trim(msg);
  66.                 show_activity_id(i, id, name, msg);
  67.             }
  68.         }
  69.        
  70.         console_print(id, "%L", id, "VOTING_CANC")
  71.         client_print(0,print_chat,"%L",LANG_PLAYER,"VOTING_CANC")
  72.         remove_task(99889988, 1)
  73.         set_cvar_float("amx_last_voting", get_gametime())
  74.     }
  75.     else
  76.         console_print(id, "%L", id, "NO_VOTE_CANC")
  77.  
  78.     return PLUGIN_HANDLED
  79. }
  80.  
  81. public delayedExec(cmd[])
  82.     server_cmd("%s", cmd)
  83.  
  84. public autoRefuse()
  85. {
  86.     log_amx("Vote: %L", "en", "RES_REF")
  87.     client_print(0, print_chat, "%L", LANG_PLAYER, "RES_REF")
  88. }
  89.  
  90. public actionResult(id, key)
  91. {
  92.     remove_task(4545454)
  93.    
  94.     switch (key)
  95.     {
  96.         case 0:
  97.         {
  98.             set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
  99.             log_amx("Vote: %L", "en", "RES_ACCEPTED")
  100.             client_print(0, print_chat, "%L", LANG_PLAYER, "RES_ACCEPTED")
  101.         }
  102.         case 1: autoRefuse()
  103.     }
  104.    
  105.     return PLUGIN_HANDLED
  106. }
  107.  
  108. public checkVotes()
  109. {
  110.     new best = 0
  111.    
  112.     if (!g_yesNoVote)
  113.     {
  114.         for (new a = 0; a < 4; ++a)
  115.             if (g_voteCount[a] > g_voteCount[best])
  116.        
  117.         best = a
  118.     }
  119.  
  120.     new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3]
  121.     new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
  122.     new iResult = g_voteCount[best]
  123.     new players[MAX_PLAYERS], pnum, i
  124.    
  125.     get_players(players, pnum, "c")
  126.    
  127.     if (iResult < iRatio)
  128.     {
  129.         new lVotingFailed[64]
  130.        
  131.         for (i = 0; i < pnum; i++)
  132.         {
  133.             format(lVotingFailed, 63, "%L", players[i], "VOTING_FAILED")
  134.             if (g_yesNoVote)
  135.                 client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio)
  136.             else
  137.                 client_print(players[i], print_chat, "%L", players[i], "VOTING_RES_2", lVotingFailed, iResult, iRatio)
  138.         }
  139.        
  140.         format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED")
  141.         log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio)
  142.        
  143.         return PLUGIN_CONTINUE
  144.     }
  145.  
  146.     g_execLen = format(g_Execute, charsmax(g_Execute), g_Answer, g_optionName[best]) + 1
  147.    
  148.     if (g_execResult)
  149.     {
  150.         g_execResult = false
  151.        
  152.         if (is_user_connected(g_voteCaller))
  153.         {
  154.             new menuBody[512], lTheResult[32], lYes[16], lNo[16]
  155.            
  156.             format(lTheResult, charsmax(lTheResult), "%L", g_voteCaller, "THE_RESULT")
  157.             format(lYes, charsmax(lYes), "%L", g_voteCaller, "YES")
  158.             format(lNo, charsmax(lNo), "%L", g_voteCaller, "NO")
  159.            
  160.             new len = format(menuBody, charsmax(menuBody), g_coloredMenus ? "\y%s: \w%s^n^n" : "%s: %s^n^n", lTheResult, g_Execute)
  161.            
  162.             len += format(menuBody[len], charsmax(menuBody) - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
  163.             format(menuBody[len], charsmax(menuBody) - len, "^n1. %s^n2. %s", lYes, lNo)
  164.             show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ")
  165.             set_task(10.0, "autoRefuse", 4545454)
  166.         }
  167.         else
  168.             set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
  169.     }
  170.    
  171.     new lVotingSuccess[32]
  172.    
  173.     for (i = 0; i < pnum; i++)
  174.     {
  175.         format(lVotingSuccess, charsmax(lVotingSuccess), "%L", players[i], "VOTING_SUCCESS")
  176.         print_color(players[i], "%L", players[i], "VOTING_RES_3", lVotingSuccess, iResult, iRatio, g_Execute)
  177.     }
  178.    
  179.     format(lVotingSuccess, charsmax(lVotingSuccess), "%L", "en", "VOTING_SUCCESS")
  180.     log_amx("Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", lVotingSuccess, iResult, iRatio, g_Execute)
  181.    
  182.     return PLUGIN_CONTINUE
  183. }
  184.  
  185. public voteCount(id, key)
  186. {
  187.     if (get_cvar_num("amx_vote_answers"))
  188.     {
  189.         new name[MAX_NAME_LENGTH]
  190.         get_user_name(id, name, charsmax(name))
  191.        
  192.         if (g_yesNoVote)
  193.             print_color(0, "%L", LANG_PLAYER, key ? "VOTED_AGAINST" : "VOTED_FOR", name)
  194.         else
  195.             print_color(0, "%L", LANG_PLAYER, "VOTED_FOR_OPT", name, key + 1)
  196.     }
  197.     ++g_voteCount[key]
  198.    
  199.     return PLUGIN_HANDLED
  200. }
  201.  
  202. public cmdVoteMap(id, level, cid)
  203. {
  204.     if (!cmd_access(id, level, cid, 2))
  205.         return PLUGIN_HANDLED
  206.    
  207.     new Float:voting = get_cvar_float("amx_last_voting")
  208.     if (voting > get_gametime())
  209.     {
  210.         console_print(id, "%L", id, "ALREADY_VOTING")
  211.         return PLUGIN_HANDLED
  212.     }
  213.    
  214.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  215.     {
  216.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  217.         return PLUGIN_HANDLED
  218.     }
  219.  
  220.     new argc = read_argc()
  221.     if (argc > 5) argc = 5
  222.    
  223.     g_validMaps = 0
  224.     g_optionName[0][0] = 0
  225.     g_optionName[1][0] = 0
  226.     g_optionName[2][0] = 0
  227.     g_optionName[3][0] = 0
  228.    
  229.     for (new i = 1; i < argc; ++i)
  230.     {
  231.         read_argv(i, g_optionName[g_validMaps], 31)
  232.        
  233.         if (is_map_valid(g_optionName[g_validMaps]))
  234.             g_validMaps++
  235.     }
  236.    
  237.     if (g_validMaps == 0)
  238.     {
  239.         new lMaps[16]
  240.        
  241.         format(lMaps, charsmax(lMaps), "%L", id, (argc == 2) ? "MAP_IS" : "MAPS_ARE")
  242.         console_print(id, "%L", id, "GIVEN_NOT_VALID", lMaps)
  243.         return PLUGIN_HANDLED
  244.     }
  245.  
  246.     new menu_msg[256], len = 0
  247.     new keys = 0
  248.    
  249.     if (g_validMaps > 1)
  250.     {
  251.         keys = MENU_KEY_0
  252.         len = format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%L: \w^n^n" : "%L: ^n^n", LANG_SERVER, "CHOOSE_MAP")
  253.         new temp[128]
  254.        
  255.         for (new a = 0; a < g_validMaps; ++a)
  256.         {
  257.             format(temp, charsmax(temp), "%d.  %s^n", a+1, g_optionName[a])
  258.             len += copy(menu_msg[len], charsmax(menu_msg) - len, temp)
  259.             keys |= (1<<a)
  260.         }
  261.        
  262.         format(menu_msg[len], charsmax(menu_msg) - len, "^n0.  %L", LANG_SERVER, "NONE")
  263.         g_yesNoVote = 0
  264.     } else {
  265.         new lChangeMap[32], lYes[16], lNo[16]
  266.        
  267.         format(lChangeMap, charsmax(lChangeMap), "%L", LANG_SERVER, "CHANGE_MAP_TO")
  268.         format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES")
  269.         format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO")
  270.         format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lChangeMap, g_optionName[0], lYes, lNo)
  271.         keys = MENU_KEY_1|MENU_KEY_2
  272.         g_yesNoVote = 1
  273.     }
  274.    
  275.     new authid[32], name[MAX_NAME_LENGTH]
  276.    
  277.     get_user_authid(id, authid, charsmax(authid))
  278.     get_user_name(id, name, charsmax(name))
  279.    
  280.     if (argc == 2)
  281.         log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name, get_user_userid(id), authid, g_optionName[0])
  282.     else
  283.         log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3])
  284.  
  285.     new msg[256];
  286.     for (new i = 1; i <= MaxClients; i++)
  287.     {
  288.         if (is_user_connected(i) && !is_user_bot(i))
  289.         {
  290.             // HACK: ADMIN_VOTE_MAP_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  291.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_MAP_1", i);
  292.             replace_all(msg, charsmax(msg), "%s", "");
  293.             replace_all(msg, charsmax(msg), ":", "");
  294.             trim(msg);
  295.             show_activity_id(i, id, name, msg);
  296.         }
  297.     }
  298.  
  299.     g_execResult = true
  300.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  301.    
  302.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  303.     g_voteRatio = get_cvar_float("amx_votemap_ratio")
  304.     g_Answer = "changelevel %s"
  305.     show_menu(0, keys, menu_msg, floatround(vote_time), (g_validMaps > 1) ? "Choose map: " : "Change map to ")
  306.     set_task(vote_time, "checkVotes", 99889988)
  307.     g_voteCaller = id
  308.     console_print(id, "%L", id, "VOTING_STARTED")
  309.     g_voteCount = {0, 0, 0, 0}
  310.    
  311.     return PLUGIN_HANDLED
  312. }
  313.  
  314. public cmdVote(id, level, cid)
  315. {
  316.     if (!cmd_access(id, level, cid, 4))
  317.         return PLUGIN_HANDLED
  318.    
  319.     new Float:voting = get_cvar_float("amx_last_voting")
  320.     if (voting > get_gametime())
  321.     {
  322.         console_print(id, "%L", id, "ALREADY_VOTING")
  323.         return PLUGIN_HANDLED
  324.     }
  325.    
  326.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  327.     {
  328.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  329.         return PLUGIN_HANDLED
  330.     }
  331.  
  332.     new quest[48]
  333.     read_argv(1, quest, charsmax(quest))
  334.    
  335.     trim(quest);
  336.    
  337.     if (contain(quest, "sv_password") != -1 || contain(quest, "rcon_password") != -1)
  338.     {
  339.         console_print(id, "%L", id, "VOTING_FORBIDDEN")
  340.         return PLUGIN_HANDLED
  341.     }
  342.    
  343.     new count=read_argc();
  344.  
  345.     for (new i=0;i<4 && (i+2)<count;i++)
  346.     {
  347.         read_argv(i+2, g_optionName[i], charsmax(g_optionName[]));
  348.     }
  349.  
  350.     new authid[32], name[MAX_NAME_LENGTH]
  351.    
  352.     get_user_authid(id, authid, charsmax(authid))
  353.     get_user_name(id, name, charsmax(name))
  354.     log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1])
  355.  
  356.     new msg[256];
  357.     for (new i = 1; i <= MaxClients; i++)
  358.     {
  359.         if (is_user_connected(i) && !is_user_bot(i))
  360.         {
  361.             // HACK: ADMIN_VOTE_CUS_{1,2} keys were designed very poorly.  Remove all : and %s in it.
  362.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_CUS_1", i);
  363.             replace_all(msg, charsmax(msg), "%s", "");
  364.             replace_all(msg, charsmax(msg), ":", "");
  365.             trim(msg);
  366.             show_activity_id(i, id, name, msg);
  367.         }
  368.     }
  369.  
  370.     new menu_msg[512], lVote[16]
  371.    
  372.     format(lVote, charsmax(lVote), "%L", LANG_SERVER, "VOTE")
  373.    
  374.     count-=2;
  375.     if (count>4)
  376.     {
  377.         count=4;
  378.     }
  379.     // count now shows how many options were listed
  380.     new keys=0;
  381.     for (new i=0;i<count;i++)
  382.     {
  383.         keys |= (1<<i);
  384.     }
  385.    
  386.     new len=formatex(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s: %s\w^n^n" : "%s: %s^n^n", lVote, quest);
  387.    
  388.     for (new i=0;i<count;i++)
  389.     {
  390.         len+=formatex(menu_msg[len], charsmax(menu_msg) - len ,"%d.  %s^n",i+1,g_optionName[i]);
  391.     }
  392.     g_execResult = false
  393.    
  394.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  395.    
  396.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  397.     g_voteRatio = get_cvar_float("amx_vote_ratio")
  398.     replace_all(quest, charsmax(quest), "%", "");
  399.     format(g_Answer, charsmax(g_Answer), "%s - %%s", quest)
  400.     show_menu(0, keys, menu_msg, floatround(vote_time), "Vote: ")
  401.     set_task(vote_time, "checkVotes", 99889988)
  402.     g_voteCaller = id
  403.     console_print(id, "%L", id, "VOTING_STARTED")
  404.     g_voteCount = {0, 0, 0, 0}
  405.     g_yesNoVote = 0
  406.    
  407.     return PLUGIN_HANDLED
  408. }
  409.  
  410. public cmdVoteKickBan(id, level, cid)
  411. {
  412.     if (!cmd_access(id, level, cid, 2))
  413.         return PLUGIN_HANDLED
  414.    
  415.     new Float:voting = get_cvar_float("amx_last_voting")
  416.     if (voting > get_gametime())
  417.     {
  418.         console_print(id, "%L", id, "ALREADY_VOTING")
  419.         return PLUGIN_HANDLED
  420.     }
  421.  
  422.     if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
  423.     {
  424.         console_print(id, "%L", id, "VOTING_NOT_ALLOW")
  425.         return PLUGIN_HANDLED
  426.     }
  427.  
  428.     new cmd[32]
  429.    
  430.     read_argv(0, cmd, charsmax(cmd))
  431.    
  432.     new voteban = equal(cmd, "amx_voteban")
  433.     new arg[32]
  434.     read_argv(1, arg, charsmax(arg))
  435.    
  436.     new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
  437.    
  438.     if (!player)
  439.         return PLUGIN_HANDLED
  440.    
  441.     if (voteban && is_user_bot(player))
  442.     {
  443.         new imname[MAX_NAME_LENGTH]
  444.        
  445.         get_user_name(player, imname, charsmax(imname))
  446.         console_print(id, "%L", id, "ACTION_PERFORMED", imname)
  447.         return PLUGIN_HANDLED
  448.     }
  449.  
  450.     new keys = MENU_KEY_1|MENU_KEY_2
  451.     new menu_msg[256], lYes[16], lNo[16], lKickBan[16]
  452.    
  453.     format(lYes, charsmax(lYes), "%L", LANG_SERVER, "YES")
  454.     format(lNo, charsmax(lNo), "%L", LANG_SERVER, "NO")
  455.     format(lKickBan, charsmax(lKickBan), "%L", LANG_SERVER, voteban ? "BAN" : "KICK")
  456.     ucfirst(lKickBan)
  457.     get_user_name(player, arg, charsmax(arg))
  458.     format(menu_msg, charsmax(menu_msg), g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lKickBan, arg, lYes, lNo)
  459.     g_yesNoVote = 1
  460.    
  461.     new bool:ipban=false;
  462.    
  463.     if (voteban)
  464.     {
  465.         get_user_authid(player, g_optionName[0], charsmax(g_optionName[]));
  466.        
  467.         // Do the same check that's in plmenu to determine if this should be an IP ban instead
  468.         if (equal("4294967295", g_optionName[0])
  469.             || equal("HLTV", g_optionName[0])
  470.             || equal("STEAM_ID_LAN", g_optionName[0])
  471.             || equali("VALVE_ID_LAN", g_optionName[0]))
  472.         {
  473.             get_user_ip(player, g_optionName[0], charsmax(g_optionName[]), 1);
  474.            
  475.             ipban=true;
  476.         }
  477.  
  478.     }
  479.     else
  480.     {
  481.         num_to_str(get_user_userid(player), g_optionName[0], charsmax(g_optionName[]))
  482.     }
  483.    
  484.     new authid[32], name[MAX_NAME_LENGTH]
  485.    
  486.     get_user_authid(id, authid, charsmax(authid))
  487.     get_user_name(id, name, charsmax(name))
  488.     log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg)
  489.  
  490.     new msg[256];
  491.     new right[256];
  492.     new dummy[1];
  493.     for (new i = 1; i <= MaxClients; i++)
  494.     {
  495.         if (is_user_connected(i) && !is_user_bot(i))
  496.         {
  497.             formatex(lKickBan, charsmax(lKickBan), "%L", i, voteban ? "BAN" : "KICK");
  498.            
  499.             // HACK: ADMIN_VOTE_FOR{1,2} keys are really weird.  Tokenize and ignore the text before the :
  500.             LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_FOR_1", i);
  501.             strtok(msg, dummy, 0, right, charsmax(right), ':');
  502.             trim(right);
  503.             show_activity_id(i, id, name, right, lKickBan, arg);
  504.         }
  505.     }
  506.  
  507.     g_execResult = true
  508.    
  509.     new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
  510.    
  511.     set_cvar_float("amx_last_voting", get_gametime() + vote_time)
  512.     g_voteRatio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio")
  513.  
  514.     if (voteban)
  515.     {
  516.         if (ipban==true)
  517.         {
  518.             g_Answer = "addip 30.0 %s";
  519.         }
  520.         else
  521.         {
  522.             g_Answer = "banid 30.0 %s kick";
  523.  
  524.         }
  525.     }
  526.     else
  527.     {
  528.         g_Answer = "kick #%s";
  529.     }
  530.     show_menu(0, keys, menu_msg, floatround(vote_time), voteban ? "Ban " : "Kick ")
  531.     set_task(vote_time, "checkVotes", 99889988)
  532.     g_voteCaller = id
  533.     console_print(id, "%L", id, "VOTING_STARTED")
  534.     g_voteCount = {0, 0, 0, 0}
  535.    
  536.     return PLUGIN_HANDLED
  537. }
  538.  
  539. stock print_color(const id, const input[], any:...)
  540. {
  541.         new count = 1, players[32]
  542.         static msg[191]
  543.         vformat(msg, 190, input, 3)
  544.  
  545.         replace_all(msg, 190, "!g", "^4")
  546.         replace_all(msg, 190, "!y", "^1")
  547.         replace_all(msg, 190, "!t", "^3")
  548.         replace_all(msg, 190, "á", "á")
  549.         replace_all(msg, 190, "é", "Ă©")
  550.         replace_all(msg, 190, "í", "Ă­")
  551.         replace_all(msg, 190, "ó", "Ăł")
  552.         replace_all(msg, 190, "ö", "ö")
  553.         replace_all(msg, 190, "ő", "Ĺ‘")
  554.         replace_all(msg, 190, "ú", "Ăş")
  555.         replace_all(msg, 190, "ü", "ĂĽ")
  556.         replace_all(msg, 190, "ű", "ű")
  557.         replace_all(msg, 190, "Á", "Á")
  558.         replace_all(msg, 190, "É", "É")
  559.         replace_all(msg, 190, "Í", "ĂŤ")
  560.         replace_all(msg, 190, "Ó", "Ă“")
  561.         replace_all(msg, 190, "Ö", "Ă–")
  562.         replace_all(msg, 190, "Ő", "Ő")
  563.         replace_all(msg, 190, "Ú", "Ăš")
  564.         replace_all(msg, 190, "Ü", "Ăś")
  565.         replace_all(msg, 190, "Ű", "Ĺ°")        
  566.  
  567.         if (id) players[0] = id; else get_players(players, count, "ch")
  568.         {
  569.                 for (new i = 0; i < count; i++)
  570.                 {
  571.                         if (is_user_connected(players[i]))
  572.                         {
  573.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  574.                                 write_byte(players[i])
  575.                                 write_string(msg)
  576.                                 message_end()
  577.                         }
  578.                 }
  579.         }
  580.         return PLUGIN_HANDLED
  581. }

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:29 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2014.09.08. 22:21
Hozzászólások: 3014
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 555 alkalommal
Hát ha nincs benne semmi új natív, akkor mehet. :D

_________________
GitHub - mforce


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:38 
Offline
Fórum Moderátor
Avatar

Csatlakozott: 2012.07.02. 17:41
Hozzászólások: 1641
Megköszönt másnak: 121 alkalommal
Megköszönték neki: 247 alkalommal
mforce írta:
Hát ha nincs benne semmi új natív, akkor mehet. :D

Pedig ez az 1.8.3 mas verzió: http://www.amxmodx.org/snapshots.php
1.8.3 mas file-okkal stúdióban fordítottam és a hiba akkor is ez volt, így hogy definiálva lett már fordítja.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 1.8.3-as adminvote hiba
HozzászólásElküldve: 2016.03.29. 17:45 
Offline
Tiszteletbeli
Avatar

Csatlakozott: 2015.04.10. 19:49
Hozzászólások: 610
Megköszönt másnak: 53 alkalommal
Megköszönték neki: 147 alkalommal
4976-s és 4996-s buildekben benne van. Többit nem tudom, most ez a kettő van leszedve + 1.8.2 profileres változata.

_________________
Néha itt, de többször nem.


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 9 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 50 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole