Raised This Month: $ Target: $400
 0% 

Req


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-12-2011 , 07:28   Req
Reply With Quote #1

Hi all,


I have to jb sw. Sometimes about admins getting the players complain.
I'm req. "as voteban" a plugin.

Players say /complain

See in the game all admins.

Voting:

10 complaints received in a admin = 1 hour banned
20 complaints received in a admin = 5 hour banned
30 complaints received in a admin = Unlimited banned
Choose_Your_Destiny is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 09-12-2011 , 11:45   Re: [ReQ] Admin to complain
Reply With Quote #2

the complaints will never start over from 0? for example if the map changes, the complaints will stay?
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-12-2011 , 11:55   Re: [ReQ] Admin to complain
Reply With Quote #3

Quote:
Originally Posted by kotinha View Post
for example if the map changes, the complaints will stay?
Yes, The complaints will stay.


EDIT:

This complaints to accept "ADMIN_LEVEL_L"

Last edited by Choose_Your_Destiny; 09-12-2011 at 12:05.
Choose_Your_Destiny is offline
wTf.
Senior Member
Join Date: Aug 2011
Location: This important?
Old 09-12-2011 , 17:01   Re: [ReQ] Admin to complain
Reply With Quote #4

nice idea.
wTf. is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 09-12-2011 , 17:07   Re: [ReQ] Admin to complain
Reply With Quote #5

I've tested everything except if the admin is really banned because I don't have a online server

And change ADMIN_LEVEL_B to whatever you want, ADMIN_LEVEL_L doesn't exist
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN    "Admin Complain"
#define AUTHOR    "thony"
#define VERSION    "1.0"

#define ADMIN_LEVEL ADMIN_LEVEL_B

new g_iFlags[22] = {
    
ADMIN_IMMUNITY// a
    
ADMIN_RESERVATION// b
    
ADMIN_KICK// c
    
ADMIN_BAN// d
    
ADMIN_SLAY// e
    
ADMIN_MAP// f
    
ADMIN_CVAR// g
    
ADMIN_CFG// h
    
ADMIN_CHAT// i
    
ADMIN_VOTE// j
    
ADMIN_PASSWORD// k
    
ADMIN_RCON// l
    
ADMIN_LEVEL_A// m
    
ADMIN_LEVEL_B// n
    
ADMIN_LEVEL_C// o
    
ADMIN_LEVEL_D// p
    
ADMIN_LEVEL_E// q
    
ADMIN_LEVEL_F// r
    
ADMIN_LEVEL_G// s
    
ADMIN_LEVEL_H// t
    
ADMIN_MENU// u
    
ADMIN_USER // z
}

new 
boolg_PlayerVotes[33][33]
new 
nVault

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /complain""ShowComplainMenu")
    
    
nVault nvault_open("AdminComplain")
}
public 
client_disconnect(id) {
    for(new 
i33i++) {
        
g_PlayerVotes[id][i] = false;
    }
}
public 
ShowComplainMenu(id) {
    new 
players[32], numadmins[33], adminsnum
    get_players
(playersnum)
    for(new 
inumi++) {
        if(
user_top_flag(players[i]) == ADMIN_LEVEL) {
            
admins[adminsnum] = players[i];
            
adminsnum++;
        }
    }
    if(
adminsnum 1) {
        
client_print(idprint_chat"[Admin Complain] There are no admins online to complain about.")
        return 
PLUGIN_HANDLED;
    }
    new 
menu menu_create("Admin Complain""MenuHandler")
    
    for(new 
iadminsnumi++) {
        new 
szName[42], szID[2], szFinal[42], iComplaintsNum getComplaintsNum(admins[i]);
        
get_user_name(admins[i], szNamecharsmax(szName))
        
num_to_str(admins[i], szIDcharsmax(szID))
        
        if(
g_PlayerVotes[id][admins[i]] == true)
            
formatex(szFinalcharsmax(szFinal), "\d%s \r(%i)"szNameiComplaintsNum)
        else
            
formatex(szFinalcharsmax(szFinal), "%s \r(%i)"szNameiComplaintsNum)
        
        
menu_additem(menuszFinalszID)
    }
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}
public 
MenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    
    new 
adminid str_to_num(data);
    
    if(
g_PlayerVotes[id][adminid] == true) {
        
client_print(idprint_chat"[Admin Complain] You can complain only once for each admin.")
        
ShowComplainMenu(id)
    }
    
    else if(
user_top_flag(adminid) == ADMIN_LEVEL) {
        new 
szNum[3], authid[32]
        
get_user_authid(adminidauthidcharsmax(authid))
        if(
nvault_get(nVaultauthidszNumcharsmax(szNum))) {
            new 
iNum str_to_num(szNum)
            
num_to_str((iNum+1), szNumcharsmax(szNum))
            
nvault_set(nVaultauthidszNum)
        }
        else
            
nvault_set(nVaultauthid"1")
        
        
g_PlayerVotes[id][adminid] = true;
        
CheckComplaints();
    }
    
    return 
PLUGIN_HANDLED;
}
CheckComplaints() {
    new 
players[32], num
    get_players
(playersnum)
    for(new 
inumi++) {
        if(
user_top_flag(players[i]) == ADMIN_LEVEL) {
            new 
complaints getComplaintsNum(players[i])
            if(
complaints == 30) {
                new 
minutes[] = "0"authid[32]
                
get_user_authid(players[i], authidcharsmax(authid))
                
                
server_cmd("kick #%d ^"You have been banned permanently from this server because you received too many complaints^""i)
                
server_cmd("banid %s %s"minutesauthid)
                
server_cmd("writeid")    
            }
            else if(
complaints == 20) {
                new 
minutes[] = "300"authid[32]
                
get_user_authid(players[i], authidcharsmax(authid))
                
                
server_cmd("kick #%d ^"You have been banned for 5 hours because you received too many complaints^""i)
                
server_cmd("banid %s %s"minutesauthid)
                
server_cmd("writeid")
            }
            else if(
complaints == 10) {
                new 
minutes[] = "60"authid[32]
                
get_user_authid(players[i], authidcharsmax(authid))
                
                
server_cmd("kick #%d ^"You have been banned for 1 hour because you received too many complaints^""i)
                
server_cmd("banid %s %s"minutesauthid)
                
server_cmd("writeid")
            }
        }
    }
}
getComplaintsNum(id) {
    new 
szNum[3], authid[32]
    
get_user_authid(idauthidcharsmax(authid))
    if(
nvault_get(nVaultauthidszNumcharsmax(szNum)))
        return 
str_to_num(szNum);
    
    return 
0;
}
user_top_flag(id) {
    new 
flags get_user_flags(id)
    
    for(new 
i22i++)
        if(
flags g_iFlags[i])
            return (
flags g_iFlags[i]);
        
    return 
0;

__________________
"If God exists, I hope he has a good excuse." - Woody Allen

Last edited by kotinha; 09-13-2011 at 13:27.
kotinha is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-12-2011 , 17:19   Re: [ReQ] Admin to complain
Reply With Quote #6

Thnx thony

Well, this complaints to accept any flag "ADMIN_LEVEL_L" ??
Choose_Your_Destiny is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 09-12-2011 , 17:31   Re: [ReQ] Admin to complain
Reply With Quote #7

there is no flag ADMIN_LEVEL_L... The L falg is ADMIN_RCON.
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-12-2011 , 17:36   Re: [ReQ] Admin to complain
Reply With Quote #8

Ohhh yes sorry
Choose_Your_Destiny is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 09-12-2011 , 18:48   Re: Req
Reply With Quote #9

Choose_Your_Destiny recompile the plugin please, it was banning the wrong person... lol

I've already edited it
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 09-13-2011 , 06:40   Re: Req
Reply With Quote #10

Quote:
Originally Posted by kotinha View Post
Choose_Your_Destiny recompile the plugin please, it was banning the wrong person... lol

I've already edited it
Thnx. I'm recompile.

Going to ask you something

I'm in game "say /complain" write.

PHP Code:
"[Admin Complain] There are no admins online to complain about." 
write? Why?

In the game have admin.
Choose_Your_Destiny is offline
Reply



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 20:09.


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