Raised This Month: $ Target: $400
 0% 

Need Help! /admins (in numbers and name)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wizz
Member
Join Date: Mar 2010
Old 02-24-2013 , 16:16   Need Help! /admins (in numbers and name)
Reply With Quote #1

I have plugin what is showing admins online if type /admins but i wanna to see in numbers too how many admins only like here :
Greetings from Estonia
Thanks

Here is my admins.sma
_____________________________________________ ________
#include <amxmodx>

/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_BAN

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/

new maxplayers
new gmsgSayText

public plugin_init() {
register_plugin("Admin Check", "1.51", "OneEyed")
maxplayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "handle_say")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
}

public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}

public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_CHECK)
get_user_name(id, adminnames[count++], 31)

len = format(message, 255, "%s Adminid serveris : ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "Admineid pole sees.")
print_message(user, message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "%s Serveri peaadmin -- %s", COLOR, contact)
print_message(user, contactinfo)
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}

Last edited by YamiKaitou; 02-26-2013 at 19:36.
wizz is offline
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 02-26-2013 , 03:25   Re: Need Help! /admins (in numbers and name)
Reply With Quote #2

Code:
len = format(message, 255, "%s Adminid serveris : ",COLOR)
---->
Code:
len = format(message, 255, "%s %i Adminid serveris : ",COLOR, count)
EDUTz is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 02-26-2013 , 06:26   Re: Need Help! /admins (in numbers and name)
Reply With Quote #3

Wizz your going to get a lot more help if you actually wrap your code in tags and indent it.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
wizz
Member
Join Date: Mar 2010
Old 02-26-2013 , 15:23   Re: Need Help! /admins (in numbers and name)
Reply With Quote #4

Quote:
Originally Posted by EDUTz View Post
Code:
len = format(message, 255, "%s Adminid serveris : ",COLOR)
---->
Code:
len = format(message, 255, "%s %i Adminid serveris : ",COLOR, count)
Thank you so much
wizz is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-26-2013 , 19:37   Re: Need Help! /admins (in numbers and name)
Reply With Quote #5

Post restored, do not blank your posts as stated in the Forum Rules
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 21:42.


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