Raised This Month: $32 Target: $400
 8% 

Revive plugin - some problem with compiling.


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 01:24   Re: Revive plugin - some problem with compiling.
Reply With Quote #11

Above code is updated to add flag and team check.

Replace ADMIN_LEVEL_A at the top with whatever flag(s) you want to require the player has.

Single flag:
const RequiredFlag = ADMIN_LEVEL_A;

Multiple flags:
const RequiredFlag = ADMIN_LEVEL_A | ADMIN_LEVEL_B;
__________________
Bugsy is online now
AdrianK69
Junior Member
Join Date: Apr 2020
Old 04-05-2020 , 01:37   Re: Revive plugin - some problem with compiling.
Reply With Quote #12

Works perfectly, thank you so much.
I really appreciate your effort!
Thank you again!
AdrianK69 is offline
AdrianK69
Junior Member
Join Date: Apr 2020
Old 04-05-2020 , 01:50   Re: Revive plugin - some problem with compiling.
Reply With Quote #13

Also can I ask you something else it's regarding implemeting this plugin in another one, kind of, so
my /who command on the server shows the admins online on the server:
The levels are like that:

Code:
new GroupNames[GROUPS_NAME][] = {

    "[DR]Founder",

    "[DR]Owner + VIP",
    
    "[DR]Owner",

    "[DR]Co-Owner + VIP",
    
    "[DR]Co-Owner",

    "[DR]Premium + VIP",
    
    "[DR]Premium",

    "[DR]Global Moderator + VIP",
    
    "[DR]Global Moderator",

    "[DR]Moderator + VIP",
    
    "[DR]Moderator",

    "[DR]Administrator + VIP",
    
    "[DR]Administrator",

    "[DR]Helper",
    
    "[DR]Helper",

    "[DR]VIP"

}


new GroupFlags[GROUPS_ACCESS][] = {

    "abcdefghijklmnopqrsu"
    
    "abcdefghijkmnopqrt",

    "abcdefghijkmnopqr",

    "abcdefghijmnpqrst",
    
    "abcdefghijmnpqrs",
    
    "bcdefgijmnpqrt",

    "bcdefgijmnpqr",
    
    "bcdefgijmnpqt",

    "bcdefgijmnpq",

    "bcdefijmnt",
    
    "bcdefijmn",

    "bcdefijt",
    
    "bcdefij",

    "ceijt",
    
    "ceij",

    "bit"

}
Now my question is: Is there any possibilty to include this flag on the /who list like let me explain it

so I give to someone the admin level Helper which is "ceij" and also I want to give him the revive flag so it will be "ceijo" but if i put that on the users.ini the player won't be showed anymore in /who.
So is there any posibility to implement this flag in that enum something like

Code:
new GroupFlags[GROUPS_ACCESS][] = {
       "ceij" || "ceijo", // so if the player has the flag ceij or ceijo to show the same admin level which is Helper?


}
I hope I explained it well and sorry to bother you again.
Thank you so much anyway for your effort.
AdrianK69 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 01:52   Re: Revive plugin - some problem with compiling.
Reply With Quote #14

How many levels of helper do you need?
__________________
Bugsy is online now
AdrianK69
Junior Member
Join Date: Apr 2020
Old 04-05-2020 , 01:56   Re: Revive plugin - some problem with compiling.
Reply With Quote #15

I have the VIP on the flag T and the revive on flag o
So I will need to do that for all the levels from VIP to Founder...
AdrianK69 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 02:04   Re: Revive plugin - some problem with compiling.
Reply With Quote #16

What is the purpose of /who, what do you expect the output to be?
__________________
Bugsy is online now
AdrianK69
Junior Member
Join Date: Apr 2020
Old 04-05-2020 , 02:11   Re: Revive plugin - some problem with compiling.
Reply With Quote #17

The /who is like amx_who it shows the online admins on the server

this is the entire code:

Code:
#include <amxmodx>

#include <amxmisc>



#define PLUGIN            "ULTIMATE WHO"

#define VERSION            "1.1"

#define AUTHOR   

         "puNx"



#define CharsMax(%1)        sizeof 

%1 - 1

#define time_shower        1.0



#define 

GROUPS_NAME        10

#define 

GROUPS_ACCESS        10



#define RRR            

255

#define GGG            255

#define BBB            

255

#define time_hud        12.0



#define 

motd_msg        "Admin's Online"



#define 

who_meniu_ad_group_msg    

"ADMINISTRATORS ONLINE^n"

#define 

who_meniu_admin_msg    "ADMINISTRATORS 

ONLINE^n^n"



#define 

who_meniu_ad_group_msg_bottom    "^nFor 

exit press 0 or 5"

#define 

who_meniu_admin_msg_bottom    "^nFor exit 

press 0 or 5"



#define    who_console_top        

"=========== ADMINS ONLINE ==========="

#define    who_console_bottom     

"================================"



new 

GroupNames[GROUPS_NAME][] = {

    "[DR]

Founder",

    "[DR]Owner",
    
    "[DR]Co-

Owner",
    
    "[DR]Premium",
    
    "[DR]Global 

Moderator",

    "[DR]Moderator + VIP",
    
    

"[DR]Moderator",
    
    "[DR]Administrator",
    
    

"[DR]Helper",

    "[DR]VIP"

}


new GroupFlags

[GROUPS_ACCESS][] = {

    

"abcdefghijklmnopqrsu",
    
    

"abcdefghijkmnopqrt",
    
    

"abcdefghijmnpqrs",

    "bcdefgijmnpqr",

    

"bcdefgijmnpq",
    
    "bcdefijmnt",
    
    

"bcdefijmn",
    
    "bcdefij",
    
    "ceij",

    "bit"

}



new GroupFlagsValue[GROUPS_NAME]



new 

who_type, who_typemeniu, who_typtable



public plugin_init() 

{

   

    register_plugin

(PLUGIN, VERSION, AUTHOR)

   

    for(new 

p_of_pw = 0 ; 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")

    

    

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") != -1 || 

containi(say, "/who") != -1 || containi(say, 

"/who") != -1  || contain(say, "/who") != -1 || 

contain(say, "/who") != -1 || contain(say, 

"/who") != -1))

        set_task

(time_shower,"cmdULTMWho",id)

    return 

PLUGIN_CONTINUE

}



public cmdULTMWho(id)

{

   

 switch(get_pcvar_num(who_type))

    {

        

case 1: who_meniu(id)

        

        case 2: 

who_motd(id)

        

        case 3: who_table(id)

    

    

        case 4: who_hud(id)

        

        case 5: 

who_console(id)

        

    }

    return 0

}



who_meniu(id)

{

    switch(get_pcvar_num

(who_typemeniu))

    {

        case 1: 

who_meniu_admin_groups(id)

        

        case 

2: who_meniu_admin(id)

    }

    return 0

}

who_meniu_admin_groups(id)

{

    new 

sPlayers[32], iNum, iPlayer

    new sName[32]

    

new szMenu[256], nLen, keys

    

    nLen = 

format(szMenu[nLen], 255, 

who_meniu_ad_group_msg)

    get_players

(sPlayers, iNum, "ch")

   

    for(new p_of_pw = 

0; p_of_pw < GROUPS_NAME ; p_of_pw++)

    {  

 

        nLen += format(szMenu[nLen], 255-

nLen,"%s^n", GroupNames[p_of_pw])

     

        

for(new a = 0; a < iNum ; a++)

        {   

            

iPlayer = sPlayers[a]

         

            if

(get_user_flags(iPlayer) == GroupFlagsValue

[p_of_pw])

            {

                get_user_name

(iPlayer, sName, sizeof sName - 1)

                

nLen += format(szMenu[nLen], 255-

nLen,"%s^n", sName)

            }   

        }

    }

    

nLen += format(szMenu[nLen], 255-nLen, 

who_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], 

iNum, iPlayer

    new sName[32]

    new szMenu

[256], nLen, keys

   

    nLen = format(szMenu

[nLen], 255, who_meniu_admin_msg)

  

    

get_players(sPlayers, iNum, "ch")

    for(new 

p_of_pw = 0; p_of_pw < GROUPS_NAME ; 

p_of_pw++)

    {

        for(new a = 0; a < iNum ; 

a++)

        {   

            iPlayer = sPlayers[a]

         

   

         if(get_user_flags(iPlayer) == 

GroupFlagsValue[p_of_pw])

            {

                

get_user_name(iPlayer, sName, sizeof sName 

- 1)

                nLen += format(szMenu[nLen], 

255-nLen,"%s^n", sName)

            }   

        }

    }

    

nLen += format(szMenu[nLen], 255-nLen, 

who_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], iNum, 

iPlayer

    new sName[32], sBuffer[1024]

    new 

iLen

    

    iLen = formatex(sBuffer, sizeof 

sBuffer - 1, "<body bgcolor=#000000><font 

color=#7b68ee><pre>")

   

    get_players

(sPlayers, iNum, "ch")

   

    for(new p_of_pw = 

0; p_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 a = 0; 

a < iNum ; a++)

        {   

            iPlayer = 

sPlayers[a]

         

            if(get_user_flags

(iPlayer) == GroupFlagsValue[p_of_pw])

            

{

                get_user_name(iPlayer, sName, 

sizeof sName - 1)

                iLen += formatex

(sBuffer[iLen], CharsMax(sBuffer) - iLen, 

"<center>%s^n</center>", sName)

            }

        

}        

    }

    show_motd(id, sBuffer, motd_msg)

 

   return 0



}



who_table(id)

{

    switch

(get_pcvar_num(who_typtable))

    {

        case 

1: table_style_one(id)

        

        case 2: 

table_style_two(id)

    }

    return 0

}

table_style_one(id)

{

    new sPlayers[32], iNum, 

iPlayer

    new sName[32], sBuffer[1024]

    new 

iLen

    

    iLen = formatex(sBuffer, sizeof 

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(sPlayers, iNum, "ch")

   

    for(new 

p_of_pw = 0; p_of_pw < GROUPS_NAME ; 

p_of_pw++)

    {

        for(new a = 0; a < iNum ; 

a++)

        {   

            iPlayer = sPlayers[a]

        

    

        if(get_user_flags(iPlayer) == 

GroupFlagsValue[p_of_pw])

            {

                

get_user_name(iPlayer, sName, sizeof sName 

- 1)

                iLen += formatex(sBuffer[iLen], 

CharsMax(sBuffer) - iLen, "<center><h4><font 

color=^"white^">%s        

%s^n</font></h4></center>", sName, 

GroupNames[p_of_pw])

            }

        }        

    }

   

 show_motd(id, sBuffer, motd_msg)

    return 0

}

table_style_two(id)

{

    new sPlayers[32], 

iNum, iPlayer

    new sName[32], sBuffer[1024]

   

 new iLen

    

    iLen = formatex(sBuffer, sizeof 

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></c

enter>")

    

    get_players(sPlayers, iNum, "ch")

 

  

    for(new p_of_pw = 0; p_of_pw < 

GROUPS_NAME ; p_of_pw++)

    {

        for(new 

a = 0; a < iNum ; a++)

        {   

            iPlayer = 

sPlayers[a]

        

            if(get_user_flags

(iPlayer) == GroupFlagsValue[p_of_pw])

            

{

                get_user_name(iPlayer, sName, 

sizeof 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>", sName, 

GroupNames[p_of_pw])

            }

        }        

    }

   

 iLen += formatex(sBuffer[iLen], CharsMax

(sBuffer) - iLen, "</table></body></html>")

    

show_motd(id, sBuffer, motd_msg)

    return 0

}



who_hud(id)

{

    new sPlayers[32], iNum, 

iPlayer

    new sName[32], sBuffer[1024]

    new 

iLen

    

    get_players(sPlayers, iNum, "ch")

   

    

for(new p_of_pw = 0; p_of_pw < 

GROUPS_NAME ; p_of_pw++)

    {   

        iLen 

+= formatex(sBuffer[iLen], CharsMax(sBuffer) 

- iLen, "=== %s ===^n", GroupNames

[p_of_pw])

     

        for(new a = 0; a < iNum ; a

++)

        {   

            iPlayer = sPlayers[a]

         

     

       if(get_user_flags(iPlayer) == 

GroupFlagsValue[p_of_pw])

            {

                

get_user_name(iPlayer, sName, sizeof sName 

- 1)

                iLen += formatex(sBuffer[iLen], 

CharsMax(sBuffer) - iLen, "%s^n", sName)

        

    }

        }        

    }

    set_hudmessage(RRR, 

GGG, BBB, 0.02, 0.24, 0, 6.0, time_hud)

    

show_hudmessage(id, sBuffer)

    return 0

}



who_console(id)

{

    new sPlayers[32], iNum, 

iPlayer

    new sName[32]



    get_players

(sPlayers, iNum)

    console_print(id, 

who_console_top)

    for(new p_of_pw = 0; 

p_of_pw < GROUPS_NAME; p_of_pw++) 

    {

      

  for(new a = 0; a < iNum ; a++)

        {

            

      

      iPlayer = sPlayers[a]

            

get_user_name(iPlayer, sName, sizeof sName 

- 1)

            if(get_user_flags(iPlayer) == 

GroupFlagsValue[p_of_pw]) 

                

console_print(id, "= %d = %s : %s", p_of_pw

+1, GroupNames[p_of_pw], sName)

            

        

    

        }

    }

    console_print(id, 

who_console_bottom)

    return 0

}
AdrianK69 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 02:13   Re: Revive plugin - some problem with compiling.
Reply With Quote #18

I would update the flags specified in the GroupFlags array to match those that your helpers will have, recompile, and they should show.
__________________
Bugsy is online now
AdrianK69
Junior Member
Join Date: Apr 2020
Old 04-05-2020 , 02:17   Re: Revive plugin - some problem with compiling.
Reply With Quote #19

Ok if you can do just for helper as an example and I will do the rest it would be great
so Helper simple: ceij - when types /who - to be displayed as Helper
Helper with revive : ceijo - when types /who - to be displayed as Helper
and helper with vip: ceijo - when types /who - to be displayed as helper
and helper with vip and revive : ceijot - at /who still helper
if it's possible ofc thank you againn
AdrianK69 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 02:22   Re: Revive plugin - some problem with compiling.
Reply With Quote #20

I would avoid modding other peoples plugins.
__________________
Bugsy is online now
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 05:56.


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