Raised This Month: $ Target: $400
 0% 

Help with Plugin Admin Check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
valascus
New Member
Join Date: Aug 2011
Old 06-22-2012 , 11:55   Help with Plugin Admin Check
Reply With Quote #1

I want that admin check's appears on the right side, as a Tutor.
I'm getting this errors:

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 38
Warning: Symbol is never used: "authid" on line 208
Header size:            800 bytes
Code size:             5408 bytes
Data size:             2388 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1733 cells (6932 bytes)
Total requirements:   24980 bytes

2 Warnings.
Done.
The Loose indentation on line 38 makes that the server cant open the Tutor.
Here is the the full source code

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define TASK_TUT 1111

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

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

new maxplayers
new gmsgSayText
 
enum
{
    RED = 1,
    BLUE,
    YELLOW,
    GREEN
}
 
new authid[33][32]
 
//New Cvars
new g_CvarCName,g_CvarMsg,g_CvarMsg2,g_CvarMsg3,g_MsgTime,g_MsgTime2
new g_MsgTutor,g_MsgTutClose

public plugin_init() {
	register_plugin("Admin Check", "1.51", "OneEyed")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	gmsgSayText = g_MsgTutor
	register_clcmd("say", "handle_say")
	register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
    // Msg
    g_MsgTutor = get_user_msgid("TutorText")
    g_MsgTutClose = get_user_msgid("TutorClose")
   
    //Cvars
    g_CvarMsg = register_cvar("amx_notice_1","Visita: portugalmultigames.pt.vu")
    g_CvarMsg2 = register_cvar("amx_notice_2","Diverte-te conosco!")
    g_CvarMsg3 = register_cvar("amx_notice_3","ADMINS ONLINE:")
   
    //Cvar Community Name
    g_CvarCName = register_cvar("amx_n_cname","Portugal Multi Games")
   
    //Cvar Time
    g_MsgTime = register_cvar("amx_n_time_1","150.0")
    g_MsgTime2 = register_cvar("amx_n_time_2","250.0")
   
    //Task
    set_task(get_pcvar_float(g_MsgTime),"CmdMsg")
    set_task(get_pcvar_float(g_MsgTime2),"CmdMsg2")
}
public client_putinserver(id)
{
        set_task(2.0,"CmdWelcomeMessage",id)
 
}
public CmdWelcomeMessage(id)
{
   
        new Cname[200],targetname[32],authid[33]
        get_user_name(id,targetname,31)
        get_user_authid(id,authid,32)
        get_pcvar_string(g_CvarCName, Cname, charsmax(Cname))
       
        new Text[192]
       
        formatex(Text,191,"Juntou-se %s (%s)^nBem-Vindo à Comunidade %s^n",targetname, authid, Cname)
           
        MsgWelcome(id,Text,GREEN,10.0)
   
}
public CmdMsg(id)
{
    new message[200]
    get_pcvar_string(g_CvarMsg, message, charsmax(message))
    new Text1[192]
       
    formatex(Text1,191,"%s", message)
       
    MakeTutor(id,Text1,YELLOW,15.0)
 
}
public CmdMsg2(id)
{    
    new message[200]
    get_pcvar_string(g_CvarMsg2, message, charsmax(message))
    new Text2[192]
       
    formatex(Text2,191,"%s", message)
       
    MakeTutor(id,Text2,YELLOW,15.0)
       
}
public CmdMsg3(id)
{    
    new message[200]
    get_pcvar_string(g_CvarMsg3, message, charsmax(message))
    new Text3[192]
       
    formatex(Text3,191,"%s", message)
       
    MakeTutor(id,Text3,YELLOW,15.0)
       
}
MakeTutor(id,Text[],Color,Float:Time = 0.0) {
   
    message_begin(MSG_ALL,g_MsgTutor,_,id)
    write_string(Text)
    write_byte(0)
    write_short(0)
    write_short(0)
    write_short(1<<Color)
    message_end()
   
    if(Time != 0.0) {
       
        set_task(Time,"RemoveTutor",id + TASK_TUT)
    }
}
MsgWelcome(id,Text[],Color,Float:Time = 0.0) {
   
    message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
    write_string(Text)
    write_byte(0)
    write_short(0)
    write_short(0)
    write_short(1<<Color)
    message_end()
   
    if(Time != 0.0) {
       
        set_task(Time,"RemoveTutor",id + TASK_TUT)
    }
}
public RemoveTutor(taskID) {
   
    new id = taskID - TASK_TUT
   
   
    message_begin(MSG_ALL,g_MsgTutClose,_,id)
    message_end()
}
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 = g_CvarMsg3 = register_cvar("amx_notice_3","ADMINS ONLINE:")
	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()
}
/////////////////////////////////////////////////////////////////////////////////////////////     
///                                                                                       ///
///                                      Tutor by Valascus                                ///
///                        Criado para a Comunidade: Portugal Multi Games                 ///
///                                                                                       ///
///                                                                                       ///
/////////////////////////////////////////////////////////////////////////////////////////////


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/
Please, anser quickly
valascus is offline
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 11-08-2012 , 14:11   Re: Help with Plugin Admin Check
Reply With Quote #2

First of, hit Ctrl+I when you are in the program.

authid is never used as you can see so you might aswell remove it.

You should still have got a .amxx file in your compile directory.
jingojang is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-08-2012 , 21:10   Re: Help with Plugin Admin Check
Reply With Quote #3

Quote:
Originally Posted by jingojang View Post
First of, hit Ctrl+I when you are in the program.
Don't suggest this unless you also mention what program it requires. CTRL+I is not a universal command
__________________
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
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-09-2012 , 09:38   Re: Help with Plugin Admin Check
Reply With Quote #4

Those are not errors but warnings that don't affect the plugin's functionality whatsoever.

Last edited by Backstabnoob; 11-09-2012 at 09:38.
Backstabnoob is offline
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 11-11-2012 , 15:48   Re: Help with Plugin Admin Check
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Don't suggest this unless you also mention what program it requires. CTRL+I is not a universal command
I am sorry it wont happen again.

Last edited by jingojang; 11-11-2012 at 15:49.
jingojang 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 06:16.


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