Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new String:vote_target[32];
- new bool:IsAllowVote[MAXPLAYERS+1] = false;
- public OnMapStart()
- {
- AddCommandListener(CommandListener);
- }
- public Action:CommandListener(client, const String:command[], args)
- {
- if (StrEqual(command, "callvote", false))
- {
- if(IsAllowVote[client] == false)
- {
- new String:arg1[16];
- GetCmdArg(1, arg1, sizeof(arg1));
- if (StrEqual(arg1, "Kick", false))
- {
- GetCmdArg(2, vote_target, sizeof(vote_target));
- DisplayVoteKickMenu(client)
- return Plugin_Handled;
- }
- }
- else if(IsAllowVote[client] == true)
- {
- return Plugin_Continue;
- }
- }
- return Plugin_Continue;
- }
- DisplayVoteKickMenu(client)
- {
- new Handle:menu = CreateMenu(MenuKick);
- if(IsClientInGame(client) && !IsFakeClient(client))
- {
- SetMenuTitle(menu, "Выберите причину кика:");
- AddMenuItem(menu, "0", "Нуб");
- AddMenuItem(menu, "1", "Расист");
- AddMenuItem(menu, "2", "Не адекват");
- AddMenuItem(menu, "3", "Даун");
- AddMenuItem(menu, "4", "Просто потому-что, я так хочу");
- AddMenuItem(menu, "5", "Я его не знаю и знать не хочу.");
- DisplayMenu(menu, client, MENU_TIME_FOREVER);
- }
- else
- {
- CloseHandle(menu);
- }
- }
- public MenuKick(Handle:menu, MenuAction:action, client, symbol)
- {
- new target = GetClientOfUserId(StringToInt(vote_target));
- if (action == MenuAction_Select)
- {
- new String:szBuffer[18];
- Format(vote_target, sizeof(target), "%N", target);
- Format(szBuffer, sizeof(szBuffer), "%s", symbol);
- if(IsClientConnected(target))
- {
- IsAllowVote[client] = true;
- FakeClientCommand(client,"callvote Kick %N",target);
- PrintToChatAll("Началось голосование за кик игрока %N по причине: %s", target, szBuffer);
- IsAllowVote[client] = false;
- }
- }
- else if (action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement