Raised This Month: $ Target: $400
 0% 

What did I forget?


Post New Thread Reply   
 
Thread Tools Display Modes
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
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-13-2004 , 11:27  
Reply With Quote #2

First of all, change #include <amxmod> to #include <amxmodx> for us
Anyway because admin_invis doesn't seem to return 0/PLUGIN_CONTINUE anywhere, make sure that the plugin is actually running (using amxx plugins).
__________________
hello, i am pm
PM is offline
Burnzy
Veteran Member
Join Date: Apr 2004
Old 06-13-2004 , 11:29  
Reply With Quote #3

im guessing he took this all from the invis wars thing...
__________________
Burnzy is offline
Send a message via AIM to Burnzy
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-13-2004 , 12:13  
Reply With Quote #4

Quote:
Originally Posted by Burnzy
im guessing he took this all from the invis wars thing...
And whats the problem with that? I guess he doesn't want to release it; he probably only does it for learning purposes.
__________________
hello, i am pm
PM is offline
pragma
New Member
Join Date: Jun 2004
Old 06-13-2004 , 12:52  
Reply With Quote #5

Quote:
Originally Posted by Burnzy
im guessing he took this all from the invis wars thing...
Only one line in there is remotely connected to invis wars, and no i don't plan on releasing it as it is.
__________________
-Pragma
pragma is offline
pragma
New Member
Join Date: Jun 2004
Old 06-13-2004 , 13:21  
Reply With Quote #6

Changeing the include would be bad, as amxmodx.inc does not contain fuctionality for set_user_rendering. I think I may have found my problem, I'll post here and let you know if I did.
__________________
-Pragma
pragma is offline
BAILOPAN
Join Date: Jan 2004
Old 06-13-2004 , 13:41  
Reply With Quote #7

set_user_rendering is in fun module.

#include <fun> gives you set_user_rendering. #include <amxmod> includes fun automatically for backwards compatibility
__________________
egg
BAILOPAN is offline
pragma
New Member
Join Date: Jun 2004
Old 06-13-2004 , 17:45  
Reply With Quote #8

yeah, it works now...apparently the compiler for amx (not amxx) is different than the amxx compiler. But yeah anyway, I changed the includes to amxmodx.inc and added fun.inc, compiled with the SC compiler included with amxx and bang it's working. Now I'll just add error checking and logging and whatnot. If anyone wants the plugin when it's complete let me know. Next step is adding a possibility for invisibility in the roll the dice plugin. On that subject, does anyone happen to know if it's possible to call amx commands/plugins etc. from and admin mod plugin?
__________________
-Pragma
pragma is offline
monkeyj
New Member
Join Date: Aug 2004
Old 08-11-2004 , 20:14   plugin
Reply With Quote #9

you stated on your post (http://forums.alliedmods.net/showthread.php?t=2677) that if anybody wanted the source, to let you know. TY in adv
monkeyj is offline
naptor
New Member
Join Date: Jul 2004
Location: UK , England
Old 08-12-2004 , 10:29   ok
Reply With Quote #10

ok , i like scripting and i am learning that code will help me learn

i am a noob

http://forums.alliedmods.net/showthread.php?t=2677

cool
__________________

:The One And Only:
naptor is offline
Send a message via MSN to naptor
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 14:39.


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