Raised This Month: $51 Target: $400
 12% 

Problem with ultimate_who modification


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trekA
Junior Member
Join Date: Mar 2020
Old 03-24-2020 , 09:16   Problem with ultimate_who modification
Reply With Quote #1

Hello. I want to modify a plugin (ultimate_who) but, I can't do it because it gives me a lot of errors.
I have a VIP Plugin which use 2 different flags (r & t). The plugin is based on VIP Silver and VIP Gold, but the problem occures with ultimate_who. When I add someone into the group of Admin, he won't show up in the MOTD if I add him the VIP flags too.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN            "ULTIMATE WHO"
#define VERSION            "1.1"
#define AUTHOR            "P.Of.Pw"

#define CharsMax(%1)        sizeof %1 - 1
#define time_shower        1.0

#define GROUPS_NAME        11
#define GROUPS_ACCESS        11

#define RRR            255
#define GGG            255
#define BBB            255
#define time_hud        12.0

#define motd_msg        "[WIDO] Staff Online"

#define who_meniu_ad_group_msg    "\y-=[Admin's]=- \r-=[Online]=-^n"
#define who_meniu_admin_msg    "\y-=[Admin's]=- \w-=[Online]=-^n^n"

#define who_meniu_ad_group_msg_bottom    "^n\wPentru a iesi apasati \y0 \w sau \y5"
#define who_meniu_admin_msg_bottom    "^n\wPentru a iesi apasati \r0 \w sau \r5"

#define    who_console_top        "=========== [WIDO] Staff ==========="
#define    who_console_bottom     "================================"

new GroupNames[GROUPS_NAME][] = {
    
"[Fondator]",
        
"[Owner]",
        
"[Co-Owner]",
        
"[God]",
        
"[Semi-God]",
        
"[Moderator]",
        
"[Admin]",
        
"[Helper]",
        
"[VIP Gold]",
        
"[VIP Silver]",
        
"[Slot]"
}

new 
GroupFlags[GROUPS_ACCESS][] = {
     
"abcdefghijklmnopqrstu",
         
"abcdefghijmnopqrst",
         
"bcdefghijmnopqs",
         
"bcdefghijmnop",
         
"bcdefhijmno",
         
"bcdefijm",
         
"bcdefij",
         
"bceij",
         
"bt",
         
"br",
         
"b"
}

new 
GroupFlagsVIPSilver[GROUPS_ACCESS][] = {
         
"abcdefghijklmnopqrstu",
         
"abcdefghijmnopqrst",
         
"bcdefghijmnopqsr",
         
"bcdefghijmnopr",
         
"bcdefhijmnor",
         
"bcdefijmr",
         
"bcdefijr",
         
"bceijr",
         
"bt",
         
"br",
         
"b"
}

new 
GroupFlagsVIPGold[GROUPS_ACCESS][] = {
         
"abcdefghijklmnopqrstu",
         
"abcdefghijmnopqrst",
         
"bcdefghijmnopqst",
         
"bcdefghijmnoprt",
         
"bcdefhijmnort",
         
"bcdefijmrt",
         
"bcdefijrt",
         
"bceijrt",
         
"bt",
         
"br",
         
"b"
}

new 
GroupFlagsValue[GROUPS_NAME]

new 
who_typewho_typemeniuwho_typtable

public plugin_init() 
{
   
    
register_plugin(PLUGINVERSIONAUTHOR)
   
    for(new 
p_of_pw p_of_pw GROUPS_NAME p_of_pw++)
        
GroupFlagsValue[p_of_pw] = read_flags(GroupFlags[p_of_pw])
   
    
register_clcmd("say""cmdSay")
    
register_clcmd("say_team""cmdSay")
    
register_concmd "amx_who""cmdWho"ADMIN_USER"" );
    
register_concmd "admin_who""cmdWho"ADMIN_USER"" );
    
    
who_type    register_cvar("cmd_who","1")
    
who_typemeniu    register_cvar("who_typemeniu","1")
    
who_typtable    register_cvar("who_typetable","2")
}

public 
cmdSay(id)
{
    new 
say[192]
    
read_args(say,192)
    if(( 
containi(say"who") != -|| containi(say"admin") != -|| containi(say"admins") != -1  || contain(say"/who") != -|| contain(say"/admin") != -|| contain(say"/admins") != -1))
        
set_task(time_shower,"cmdULTMWho",id)
    return 
PLUGIN_CONTINUE
}

public 
cmdULTMWho(id)
{
    switch(
get_pcvar_num(who_type))
    {
        case 
1who_meniu(id)
        
        case 
2who_motd(id)
        
        case 
3who_table(id)
        
        case 
4who_hud(id)
        
        case 
5who_console(id)
        
    }
    return 
0
}

who_meniu(id)
{
    switch(
get_pcvar_num(who_typemeniu))
    {
        case 
1who_meniu_admin_groups(id)
        
        case 
2who_meniu_admin(id)
    }
    return 
0
}
who_meniu_admin_groups(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]
    new 
szMenu[256], nLenkeys
    
    nLen 
format(szMenu[nLen], 255who_meniu_ad_group_msg)
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
nLen += format(szMenu[nLen], 255-nLen,"\r%s^n"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
nLen += format(szMenu[nLen], 255-nLen,"\w%s^n"sName)
            }   
        }
    }
    
nLen += format(szMenu[nLen], 255-nLenwho_meniu_ad_group_msg_bottom)
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<9)
    
show_menu(id,keys,szMenu,-1)
    return 
0
}

who_meniu_admin(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]
    new 
szMenu[256], nLenkeys
   
    nLen 
format(szMenu[nLen], 255who_meniu_admin_msg)
  
    
get_players(sPlayersiNum"ch")
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
nLen += format(szMenu[nLen], 255-nLen,"\r%s^n"sName)
            }   
        }
    }
    
nLen += format(szMenu[nLen], 255-nLenwho_meniu_admin_msg_bottom)
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<9)
    
show_menu(id,keys,szMenu,-1)
    return 
0
}

who_motd(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
   
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h5><font color=^"red^">%s^n</font></h5></center>"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center>%s^n</center>"sName)
            }
        }        
    }
    
show_motd(idsBuffermotd_msg)
    return 
0

}

who_table(id)
{
    switch(
get_pcvar_num(who_typtable))
    {
        case 
1table_style_one(id)
        
        case 
2table_style_two(id)
    }
    return 
0
}
table_style_one(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h3><b><font color=^"red^">NUME            -    ACCES</font></h3></b></center>")
    
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
        
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h4><font color=^"white^">%s        %s^n</font></h4></center>"sNameGroupNames[p_of_pw])
            }
        }        
    }
    
show_motd(idsBuffermotd_msg)
    return 
0
}
table_style_two(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
    
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<html><head><title>a</title></head>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<br><br><center><body><table border>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<tr><td><h3><b><font color=^"red^">NUME</td><td></h3></b> <h3><b><font color=^"red^">ACCES</td></h3></font></b></center>")
    
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
        
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><tr><td><h4><b><font color=^"white^">%s<td></b></h4> <h4><b><font color=^"white^">%s </td></h4></font></b></center>"sNameGroupNames[p_of_pw])
            }
        }        
    }
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"</table></body></html>")
    
show_motd(idsBuffermotd_msg)
    return 
0
}

who_hud(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    get_players
(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"=== %s ===^n"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"%s^n"sName)
            }
        }        
    }
    
set_hudmessage(RRRGGGBBB0.020.2406.0time_hud)
    
show_hudmessage(idsBuffer)
    return 
0
}

who_console(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]

    
get_players(sPlayersiNum)
    
console_print(idwho_console_top)
    for(new 
p_of_pw 0p_of_pw GROUPS_NAMEp_of_pw++) 
    {
        for(new 
0iNum a++)
        {
            
            
iPlayer sPlayers[a]
            
get_user_name(iPlayersNamesizeof sName 1)
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw] || get_user_flags(iPlayer) == GroupFlagsValueVIPSilver[p_of_pw]) || get_user_flags(iPlayer) == GroupFlagsValueVIPGold[p_of_pw]) 
                
console_print(id"= %d = %s : %s"p_of_pw+1GroupNames[p_of_pw], sName)
            
            
        }
    }
    
console_print(idwho_console_bottom)
    return 
0

trekA 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 18:55.


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