This is how i use it atm
Dont mide the unused includes, cause there is more whre is going to be used.
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <amxmisc>
#include <string>
#include <fun>
#define TE_DLIGHT 27
#define TE_ELIGHT 28
public plugin_init()
{
register_plugin("stuff","Beta","Stephen")
register_clcmd(".fx.fxWorldLight","worldlight",ADMIN_ALL,"[radius], [red], [green], [blue], [brightness], [float:lifetime], [float:decayrate]")
return PLUGIN_CONTINUE;
}
//World Light
//===================
public worldlight(id, level, cid)
{
if(!cmd_access(id,level,cid,5))
return PLUGIN_HANDLED
new user[33], space[1], r[4], g[4], b[4], bright[1], time[1], rate[1]
read_argv(0, user, 32)
read_argv(1, space, 1)//RADIUS
new radius = str_to_num(space)
read_argv(2, r, 3)//Colors
read_argv(3, g, 3)
read_argv(4, b, 3)
new red = str_to_num(r)
new green = str_to_num(g)
new blue = str_to_num(b)
read_argv(5, bright, 1)//Brightness
new brightness = str_to_num(bright)
read_argv(6, time, 1)//LifeTime
new life = str_to_num(time)
read_argv(7, rate, 1)//Decayrate
new decayrate = str_to_num(rate)
new origin[3]
get_user_origin(id,origin)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, origin)
write_byte( TE_DLIGHT )
write_coord( origin[0] ); //coord coord coord (position)
write_coord( origin[1] );
write_coord( origin[2] );
write_byte( radius ) //Radius
write_byte( red ) //Red
write_byte( green ) //Green
write_byte( blue ) //Blue
write_byte( brightness ) //Brightness
write_byte( life ) //Life
write_byte( decayrate ) //Decay Rate
message_end();
return PLUGIN_HANDLED
}
//Screen Fade
//===================