Code:
#include <amxmod>
#include <amxmisc>
public plugin_init()
{
register_plugin("Random Glow", "1", "Alfred")
register_cvar("amx_glowdelay","40")
}
new Float:LastGambleTime[33]
public client_connect(id){
LastGambleTime[id] = -1000.0
return PLUGIN_CONTINUE
}
public client_disconnect(id){
LastGambleTime[id] = -1000.0
return PLUGIN_CONTINUE
}
public HandleSay(id){
new Speech[192]
read_args(Speech,192)
remove_quotes(Speech)
if(HandleSay2(id,Speech))
{
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public HandleSay2(id,Speech[])
{
if ( (equali(Speech, "glow me")) )
{
if (get_gametime() < LastGambleTime[id] + get_cvar_float("amx_glowdelay"))
{
client_print(id,print_chat, "[AMXX] <Painter> Hey, i ain't no machine! Let me have some rest!")
return PLUGIN_HANDLED
}
new User[32]
get_user_name(id,User,32)
new Red = random(256)
new Green = random(256)
new Blue = random(256)
set_user_rendering(id,kRenderFxGlowShell, Red, Green, Blue, kRenderNormal,16)
client_print(id,print_chat, "[AMXX] <Painter> I've painted you.", User)
client_print(0,print_chat, "[AMXX] <Painter> Ok, I've painted %s. Next!", User)
}
LastGambleTime[id] = get_gametime()
return PLUGIN_CONTINUE
}
What this plugin, technically, is to paint the user with random colours when he / she says "glow me". When i compile the .sma, there's no error. But somehow, it doesn't work. It shows the plugin as running, but when i type "glow me", nothing happens. Can some one help me?
And btw, i copied those codes from someone. I ain't a good Small programmer, so i took bits and parts from different codes.