PHP Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#define PLUGIN "Cloak"
#define VERSION "1.0"
#define AUTHOR "Master A.K.A. HLM"
new g_iVisibilityState[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_cloak","give_invis", ADMIN_KICK,"<name|#userid|steamid> <on/half/off> ")
}
public give_invis(id,level,cid)
{
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new szarg1[33], szarg2[8]
read_argv(1,szarg1,32)
read_argv(2,szarg2,7)
new mode = str_to_num(szarg2)
new target = cmd_target(id,szarg1,2)
new name[32];
get_user_name(id, name, 32)
if(target)
{
g_iVisibilityState[target] = mode
switch(mode)
{
case 0:
{
if(is_user_alive(target))
set_user_rendering(target,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255)
client_print(target,print_chat,"-[EVIL]- %s is no longer cloaked ",name)
}
case 1:
{
if(is_user_alive(target))
set_user_rendering(target,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,85)
client_print(target,print_chat, "-[EVIL]- %s is partially cloaked ",name)
// Partial Cloak
}
case 2:
{
if(is_user_alive(target))
set_user_rendering(target,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)
client_print(target,print_chat, "-[EVIL]- %s is completely cloaked ",name)
// Full Cloak
}
}
}
return PLUGIN_HANDLED
}
I wantto change case 0: case 1: case 2: to equal on half and off.. then I dont have to run amx_cloak %s <0/1/2>
how would I do this?
EDIT: This has been solved, view
post 16 for the current issue at hand..
__________________