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.
__________________