Raised This Month: $ Target: $400
 0% 

What did I forget?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pragma
New Member
Join Date: Jun 2004
Old 06-13-2004 , 10:26   What did I forget?
Reply With Quote #1

Hi guys, some very simple code here. I didn't bother researching this scripting language all that much as I prefer to jump into things, and I'm allready quite familiar with C/C++. Other than the lack of error checking and loggign, what did I forget here?

Code:
/*
Made by Pragma
Version .9 alpha
*/

#include <amxmod>
#include <amxmisc>


public admin_invis(id,level,cid){
	if (!cmd_access(id,level,cid,3)) {
		return PLUGIN_HANDLED
	}else {
		new invis[3]
		new i_invis
		new name[32]

		read_argv(1,name,32)
		read_argv(2,invis,3)

		i_invis = str_to_num(invis)
		new player = cmd_target(id,name,3)

		if (!player) return PLUGIN_HANDLED

		set_user_rendering(player,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,i_invis)

		get_user_name(player,name,32)
		console_print(id,"[AMX] Client ^"%s^" invis has been set",name)
	}
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("Admin Invisibility",".9","Pragmatic Studios")
	register_concmd("amx_invis","admin_invis",ADMIN_SLAY,"<part of nick> <1-255> (1 total invis, 255 total vis)")
	return PLUGIN_CONTINUE
}
Basically I just looked at other scripts and made up what I THOUGHT would work. Now when I type amx_invis with or without arguments in console, I'm told the command doesn't exist. Do i have to create another instance somewhere? I was under the impression that plugin_init handled that... And yes the plugin is being initialized in plugins.ini.
__________________
-Pragma
pragma is offline
 


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 14:39.


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