Raised This Month: $ Target: $400
 0% 

what's wrong with the plugin ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
revo4cs
Junior Member
Join Date: Jan 2013
Old 01-19-2013 , 14:24   what's wrong with the plugin ?
Reply With Quote #1

I just modified the [Admin check plugin] but the plugin have a bug when i just use the slash.amxx plugin, the check admin plugin did not show me the result of the plugin, but when i recompile i got errors.

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

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

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

new maxplayers
new gmsgSayText
new pcvar_Display


public plugin_init() {
	register_plugin("Admin Online", "0.1a", "R3VO")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	register_concmd("say /whoadmin", "handle_say")
	register_concmd("say /admin", "handle_say")
	register_concmd("say /admins", "handle_say")
	register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
        pcvar_Display = register_cvar("sv_aodisplay", "0")
}

public handle_say(id)
 {
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		client_print(0, print_adminlist,)
	}
	else
	{
		client_print(id, print_adminlist)
	}
        return PLUGIN_HANDLED
}

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 ADMINS ONLINE: ",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, "No admins online.")
		print_message(user, message)
	}
	
	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %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()
}
Errors:

Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// admin_on.sma
// C:\Program Files (x86)\Steam\steamapps\revoportal1\dedicated server\cstrike\addons\amxmodx\scripting\admin_on.sma(33) : error 029: invalid expression, assumed zero
// C:\Program Files (x86)\Steam\steamapps\revoportal1\dedicated server\cstrike\addons\amxmodx\scripting\admin_on.sma(37) : error 029: invalid expression, assumed zero
// 
// 2 Errors.
// Could not locate output file C:\Program Files (x86)\Steam\steamapps\revoportal1\dedicated server\cstrike\addons\amxmodx\scripting\compiled\admin_on.amx (compile failed).
//
// Compilation Time: 0.08 sec
// ----------------------------------------

// File not found.

:crab
revo4cs is offline
revo4cs
Junior Member
Join Date: Jan 2013
Old 01-19-2013 , 17:07   Re: what's wrong with the plugin ?
Reply With Quote #2

No one wants to help me ? this is important for me

Last edited by revo4cs; 01-19-2013 at 17:12.
revo4cs is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-19-2013 , 18:58   Re: what's wrong with the plugin ?
Reply With Quote #3

you have a Unnecessary "," at line: 30+
PHP Code:
if(get_pcvar_num(pcvar_Display) == 1

        
client_print(0print_adminlist,)
}
else
{
         
client_print(idprint_adminlist)

client_print(0, print_adminlist,)
-> wrong ","
and also wrong usage of function.
client_print(id,type,Message[],arg[]);
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-19-2013 at 18:58.
AngeIII is offline
Send a message via Skype™ to AngeIII
revo4cs
Junior Member
Join Date: Jan 2013
Old 01-20-2013 , 08:47   Re: what's wrong with the plugin ?
Reply With Quote #4

Thanks AngeIII, i try now
like this maybe ?
PHP Code:
if(get_pcvar_num(pcvar_Display) == 1

        
client_print(0print_chatprint_adminlist);
}
else
{
        
client_print(idprint_chatprint_adminlist);


Last edited by revo4cs; 01-20-2013 at 08:54.
revo4cs is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-20-2013 , 08:55   Re: what's wrong with the plugin ?
Reply With Quote #5

your print_adminlist is just function. so you can call it like this:

PHP Code:
if(get_pcvar_num(pcvar_Display) == 1

        
print_adminlist(0)
}
else
{
        
print_adminlist(id)

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-20-2013 at 08:55.
AngeIII is offline
Send a message via Skype™ to AngeIII
revo4cs
Junior Member
Join Date: Jan 2013
Old 01-20-2013 , 09:03   Re: what's wrong with the plugin ?
Reply With Quote #6

It's work. thank you AngeIII. I'm still beginner in amxx programming
revo4cs 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 04:11.


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