AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved amx_who (https://forums.alliedmods.net/showthread.php?t=329449)

lexzor 12-24-2020 16:56

amx_who
 
hello. i have this code

PHP Code:

#include <amxmodx>
#include <amxmisc>
#define VIP_FLAG ADMIN_LEVEL_H

#define MAX_GROUPS 10 //if there are more than 14 ranks, increase this number to whatever number of ranks you want or already have

new g_groupNames[MAX_GROUPS][] = 
{
"[1] Founder",
"[2] Owner",
"[3] Co-Owner",
"[4] Veteran",
"[5] Administrator",
"[6] Super-Moderator",
"[7] Moderator",
"[8] Helper",
"[9] VIP",
"[10] Slot"
}

new 
g_groupFlags[MAX_GROUPS][] = 
{
"abcdefghijklmnopqrstuxy",
"bcdefghijklmnopqrsu",
"bcdefghijmnopqsu",
"bcdefghijmnopqs",
"bcdefgijmnpq",
"bcdefgijmn",
"bcdefgijm",
"bcdefgij",
"it",
"b"
}

new 
g_groupFlagsVIP[MAX_GROUPS][] = 
{
"abcdefghijklmnopqrstuxy",
"bcdefghijklmnopqrsut",
"bcdefghijmnopqsut",
"bcdefghijmnopqst",
"bcdefgijmnpqt",
"bcdefgijmnt",
"bcdefgijmt",
"bcdefgijt",
"it",
"b"
}
new 
g_groupFlagsValue[MAX_GROUPS]
new 
g_groupFlagsVIPValue[MAX_GROUPS]

public 
plugin_init()
{
register_plugin("CSGO Classy amx_who""1.0""renegade")

register_concmd("amx_who""cmdWho"0)
register_concmd("who""cmdWho"0)
register_clcmd("say /who""cmdWho")
register_clcmd("say /amx_who""cmdWho")
register_clcmd("say_team /who""cmdWho")
register_clcmd("say_team /amx_who""cmdWho")
for(new 
0MAX_GROUPSi++) 
{
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
g_groupFlagsVIPValue[i] = read_flags(g_groupFlagsVIP[i])
}
}

public 
cmdWho(id
{
new 
players[32], inumplayername[32], ia
get_players
(playersinum)
console_print(id"[=========>CSGO.JOINET.RO<=========]")

for(
0MAX_GROUPSi++)
{
console_print(id"%s"g_groupNames[i])
for(
0inum; ++a
{
player players[a]
get_user_name(playername31)
if((
get_user_flags(player) == g_groupFlagsValue[i]) && (get_user_flags(player) != g_groupFlagsVIPValue[i])) 
{

    
console_print(id"%s"name)

if((
get_user_flags(player) != g_groupFlagsValue[i]) && (get_user_flags(player) == g_groupFlagsVIPValue[i])) 
{

    
console_print(id"[VIP] %s"name)

}
}
console_print(id"[=========>CSGO.JOINET.RO<=========]")
return 
PLUGIN_HANDLED


i m trying to make it in that way:
if player have flags from g_groupFlagsVIP show him [VIP] before his name and when he has g_groupFlags to show just his name.

in the code blow is my last try, but don t show anything. some ideas ?

lexzor 12-24-2020 17:16

Re: amx_who
 
it works. Nevermind, sorry: ))


All times are GMT -4. The time now is 14:11.

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