Raised This Month: $ Target: $400
 0% 

[HELP]Modified amx_who


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kakkarot
New Member
Join Date: Oct 2010
Old 10-08-2010 , 06:09   [HELP]Modified amx_who
Reply With Quote #1

Hello, i would like your help in modifying a plugin similar to the amx_who command. This is the plugin's .sma :


PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_ADMIN
#define MAX_GROUPS 9
new g_groupNames[MAX_GROUPS][] = {
"-=[Owner]=-",
"-=[Co-Owner]=-",
"-=[God]=-",
"-=[Super Moderator]=-",
"-=[Moderator]=- ",
"-=[Administrator]=- ",
"-=[Semi Administrator]=-",
"-=[Helper]=-",
"-=[Slot]=-"
}
new 
g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"bcdefghijklmnopqrst",
"bcdefghijlmnopqrst",
"bcdefghijlmnopqrs",
"bcdefgijlmnopqr",
"bcdefgijmnop",
"bcdefgijmn",
"bcefijmn",
"b"
}
new 
g_groupFlagsValue[MAX_GROUPS]
public 
plugin_init() 
{
register_plugin("Admin_Who""1.0""SileNNNT")
register_concmd("admin_who""cmdWho",ACCESS)
for(new 
0MAX_GROUPSi++) 
{
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
}
}
public 
cmdWho(id
{
new 
players[32], inumplayername[32], ia
get_players
(playersinum)
console_print(id"[ Admini Online ]")
for(
0MAX_GROUPSi++) 
{
console_print(id"-----[%d]%s-----"i+1g_groupNames[i])
for(
0inum; ++a
{
player players[a]
get_user_name(playername31)
if(
get_user_flags(player) == g_groupFlagsValue[i]) 
{
console_print(id"%s"name)
}
}
}
console_print(id"[ Admini Online ]")
return 
PLUGIN_HANDLED

The problem is that the command admin_who is usable to all classes of flags instead of ADMIN_ADMIN. this is what i want : to make the command admin_who only usable by admins. I know that amx_who does that very thing, but it shows the accesses chaotic somehow. this way it would be clear what's the rank of every admin.

I also tried to modify cmdaccess.ini as follows :
Code:
"admin_who"     "y"           ; admin_who.amxx
with no effect whatsoever on the command.

Thank You in advance for your help!

P.S. i have searched prior to my posting for a solution but i haven't found one.

Last edited by Kakkarot; 10-08-2010 at 11:28. Reason: incomplete
Kakkarot is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 10-08-2010 , 06:20   Re: [HELP]Modified amx_who
Reply With Quote #2

Please indent your code and wrap it in PHP tags so it's readable
hornet is offline
Kakkarot
New Member
Join Date: Oct 2010
Old 10-08-2010 , 11:27   Re: [HELP]Modified amx_who
Reply With Quote #3

yeah, sorry for that. my first post here on alliedmods forums.
Kakkarot is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-08-2010 , 12:31   Re: [HELP]Modified amx_who
Reply With Quote #4

If it works in amx_who then you should look at the amx_who command (obviously). Hint: admincmd.sma line 1008.
__________________
fysiks is offline
Kakkarot
New Member
Join Date: Oct 2010
Old 10-09-2010 , 13:50   Re: [HELP]Modified amx_who
Reply With Quote #5

thanks for your advice. i managed to make it work. and fysiks i was working with both plugins but i couldn't make it work as it should. I managed today.

For who is interested :

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MAX_GROUPS 9
new g_groupNames[MAX_GROUPS][] = {
"-=[Owner]=-",
"-=[Co-Owner]=-",
"-=[God]=-",
"-=[Super Moderator]=-",
"-=[Moderator]=- ",
"-=[Administrator]=- ",
"-=[Semi Administrator]=-",
"-=[Helper]=-",
"-=[Slot]=-"
}
new 
g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"abcdefghijklmnopqrst",
"bcdefghijlmnopqrst",
"bcdefghijlmnopqrs",
"bcdefgijlmnopqr",
"bcdefgijmnop",
"bcdefgijmn",
"bcefijmn",
"b"
}
new 
g_groupFlagsValue[MAX_GROUPS]
public 
plugin_init() {
register_plugin("Admin_Who""1.0""SileNNNT")
register_concmd("admin_who""cmdWho"ADMIN_KICK)
for(new 
0MAX_GROUPSi++) {
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
}
}

public 
cmdWho(idlevelcid
{

if (!
cmd_access(idlevelcid1))
   
   return 
PLUGIN_HANDLED
   
new players[32], inumplayername[32], ia
get_players
(playersinum)
console_print(id"[ Admini Online ]")
for(
0MAX_GROUPSi++) {
console_print(id"-----[%d]%s-----"i+1g_groupNames[i])
for(
0inum; ++a) {
player players[a]
get_user_name(playername31)
if(
get_user_flags(player) == g_groupFlagsValue[i]) {
console_print(id"%s"name)
}
}
}
console_print(id"[ Admini Online ]")
return 
PLUGIN_HANDLED

Kakkarot is offline
Reply


Thread Tools
Display Modes

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 10:16.


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