AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   admin list edit (https://forums.alliedmods.net/showthread.php?t=255328)

Adomaz1 01-13-2015 11:27

admin list edit
 
hello, I am new on scripting, can someoe help me with admin list? I want, that it would look like this:

[!] Prisijunge administratoriai: nick, nick1, nick2 I want that nicks and [!] would be team color, and Prisijunge administratoriai green color, because everything is green, and the code is hard for me so I cant understand.. :/

the code:

Spoiler

Obada 01-13-2015 12:24

Re: admin list edit
 
Try this.

Not compiled, nor tested.

PHP Code:

include <amxmodx>

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

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

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"CONTACTFCVAR_SERVER)
}

public 
handle_say(id) {
new 
said[192]
read_args(said,192)
if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
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 
idcountxlen

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

len format(message255"%sPrisijunge administratoriai: ",COLOR)
if(
count 0) {
for(
count x++) {
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
if(
len 96 ) {
print_message(usermessage)
len format(message255"%s ",COLOUR)
}
}
print_message(usermessage)
}
else {
len += format(message[len], 255-len"No admins online.")
print_message(usermessage)
}

get_cvar_string("amx_contactinfo"contact63)
if(
contact[0]) {
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
print_message(usercontactinfo)
}
}

print_message(idmsg[]) {
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()



Adomaz1 01-14-2015 15:18

Re: admin list edit
 
fixed it myself. :)
I just added ^x01 codes, and it worked. :)

len = format(message, 255, "%s^x04[!] ^x01Prisijunge administratoriai: ^x04",COLOR)


All times are GMT -4. The time now is 15:32.

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