Raised This Month: $ Target: $400
 0% 

Cannot cout admin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
VINAGHOST
Member
Join Date: Aug 2016
Location: Việt Nam
Old 07-26-2017 , 03:43   Cannot cout admin
Reply With Quote #1

This is my code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>

#define PLUGIN "BB: ADMIN CHECK"
#define VERSION "1.0"
#define AUTHOR "VINAGHOST"

new text_msg
const AdminFlag ADMIN_BAN
new hadadminadmin[33], p_report[33], checking[33], originold[33][3]
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /report""report")
    
register_clcmd("say /check""check"ADMIN_BAN)
    
register_clcmd("say /done""done"ADMIN_BAN)
    
    
text_msg get_user_msgid("SayText")
    
hadadmin 0
}
public 
telemod(idtarget)
{
    if (!
is_user_alive(id) || !is_user_alive(target)) return;
    
    
p_report[target] = false
    checking
[id] = true
    
    fm_set_entity_visibility
(id0)
    
    new 
origin[3]
    
get_user_origin(targetorigin)
    
get_user_origin(idoriginold[id])
    
    
set_user_origin(idorigin)
    
    
set_user_noclip(id0)
    
    
client_color(id"!g[Report ADMIN] !yAfter you check, say /done to be normal.")
}
public 
done(idlevelcid)
{
    if(!
cmd_access(idlevelcid0)) return PLUGIN_CONTINUE
    
if(!checking[id]) return PLUGIN_CONTINUE
    
    fm_set_entity_visibility
(id1)
    
set_user_noclip(id1)
    
set_user_origin(idoriginold[id])
    return 
PLUGIN_CONTINUE
}
public 
client_authorized(id)
{
    if( 
is_user_connected(id) )
    {
        if (
get_user_flags(id) & AdminFlag)
        {
            
hadadmin++
            
admin[id] = true
        
}
    }
    
p_report[id] = false
    checking
[id] = false
}
public 
client_disconnect(id)
{
    if( 
admin[id] )
    {
        
hadadmin--
        
admin[id] = false
    
}
    
p_report[id] = false
    checking
[id] = false
}
public 
check(idlevelcid)
{
    if(!
cmd_access(idlevelcid0))
        return 
PLUGIN_CONTINUE
    
new check_p menu_create("Check player:^n""check_menu")
    
    new 
Players[32], PlayersNumindex
    get_players
(PlayersPlayersNum)
    new 
PlayerName[43], UserId[6]
    for(new 
PlayersNumi++)
    {
        
index Players[i]
        if (
index == id ) continue; 
        
get_user_name(indexPlayerNamecharsmax(PlayerName))
        
num_to_str(get_user_userid(index), UserIdcharsmax(UserId))
        
format(PlayerNamecharsmax(PlayerName), "%s%s"p_report[index] ? "\r" "\w"PlayerName)
        
menu_additem(check_pPlayerNameUserId0)
    }
    
    
menu_display(idcheck_p0)
    return 
PLUGIN_CONTINUE
}
public 
check_menu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return;
    }
    
    new 
UserId[6], Name[32], AccessCallBack
    menu_item_getinfo
(menuitemAccessUserIdcharsmax(UserId), Namecharsmax(Name), CallBack)
    
    new 
IntUserId str_to_num(UserId)
    new 
Target find_player("k"IntUserId)
    
    if(
Target)
    {
        if (!
is_user_alive(id)) return;
        
        
telemod(idTarget)
    }
    else
        
client_color(id"!g[Report ADMIN] !ySorry but !g%s escaped"Name)
    
    
menu_destroy(menu)
}
public 
report(id)
{
    if (
hadadmin)
    {
        new 
report_main menu_create("Reported:""report_menu")
        
        
menu_additem(report_main"Need help""admin will teleport to you");
        
menu_additem(report_main"Report someone""admin will check this guy for you")
        
        
menu_setpropreport_mainMPROP_EXITMEXIT_ALL );
        
menu_displayidreport_main);
    }
    else
    {
        
client_color(id,"!g[Report ADMIN] !ySorry but no admin is online")
    }
    return 
PLUGIN_CONTINUE
}
public 
report_menu(idmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            
client_color(id"!g[Report ADMIN] !yYou have sent the report, admin will teleport to you.")
            new 
Players[32], Numindex
            get_players
(PlayersNum"c")
            for(new 
iNumi++)
            {
                
index Players[i]
                if(
get_user_flags(index) & AdminFlag)
                {
                    new 
name[33]
                    
get_user_name(id,name,charsmax(name))
                    
client_color(index"!g[Report ADMIN] !y%s need help."name)
                }
            }
            
p_report[id] = true
        
}
        case 
1:
            
report_player(id)
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}
public 
report_player(id)
{
    new 
report_p menu_create("Bao cao player:""report_playermenu")
    
    new 
Players[32], PlayersNumindex
    get_players
(PlayersPlayersNum)
    new 
PlayerName[32], UserId[6]
    
    for(new 
PlayersNumi++)
    {
        
index Players[i]
        if (
index == id ) continue; 
        
get_user_name(indexPlayerNamecharsmax(PlayerName))
        
num_to_str(get_user_userid(index), UserIdcharsmax(UserId))
        
        
menu_additem(report_pPlayerNameUserId0)
    }
    
    
menu_display(idreport_p0)
}
public 
report_playermenu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
    }
    
    new 
UserId[6], Name[32], AccessCallBack
    menu_item_getinfo
(menuitemAccessUserIdcharsmax(UserId), Namecharsmax(Name), CallBack)
    
    new 
IntUserId str_to_num(UserId)
    new 
Target find_player("k"IntUserId)
    
    if(
Target)
    {
        
client_color(id"!g[Report ADMIN] !yYou have sent the report. Admin will check !g%s"Name)
        new 
Players[32], Numindex
        get_players
(PlayersNum"c")
        for(new 
iNumi++)
        {
            
index Players[i]
            if(
get_user_flags(index) & AdminFlag)
            {
                new 
nameT[33]
                
get_user_name(id,nameT,charsmax(nameT))
                
client_color(index"!g[Report ADMIN] !y%s need admin check %s."nameTName)
            }
        }
        
p_report[Target] = true
    
}
    else
        
client_color(id"!g[Report ADMIN] !ySorry but !g%s escaped"Name)
    
    
menu_destroy(menu)
}

stock client_color(const id, const input[], any:...) 

    new 
count 1players[32
    
    static 
msg[191
    
    
vformat(msg190input3
    
    
replace_all(msg190"!g""^4"
    
replace_all(msg190"!y""^1"
    
replace_all(msg190"!t""^3"
    
replace_all(msg190"!t2""^0"
    
    if (
idplayers[0] = id; else get_players(playerscount"sch"
    
    for (new 
0counti++) 
    { 
        if (
is_user_connected(players[i])) 
        { 
            
message_begin(MSG_ONE_UNRELIABLEtext_msg_players[i]) 
            
write_byte(players[i]) 
            
write_string(msg
            
message_end() 
        } 
    }  
}
stock fm_set_entity_visibility(indexvisible 1) { 
    
set_pev(indexpev_effectsvisible == pev(indexpev_effects) & ~EF_NODRAW pev(indexpev_effects) | EF_NODRAW); 

    return 
1

But when I enter my server and say /check, noting is happening. And when I say /report, I take this
"[Report ADMIN] Sorry but no admin is online" even then I already have flag ADMIN_BAN
So anyone help me please and sorry for my bad English, I'm from Viet Nam ._.

Last edited by VINAGHOST; 07-26-2017 at 08:27. Reason: sorry for mistakes I use my language in code and I change to English before I post ._.
VINAGHOST is offline
 



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 23:12.


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