umm ok...i added that and if id == 1 but it doesnt work. I tried changing return PLUGIN_CONTINUE to just continue but it still doesnt work....
this is what i have right now
btw, testing this with bots so dont know if thats the prob
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "Super Sheild!"
#define VERSION "1.0"
#define AUTHOR "Zenith77"
new mXBeam
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar( "sheild_radius", " 200 " )
register_clcmd( "amx_sheild", "activate_sheild", ADMIN_IMMUNITY, " if you dont know, dont worry " )
}
public plugin_precache() {
mXBeam = precache_model( "sprites/xbeam1.spr" )
}
public activate_sheild(id, level, cid) {
if( !cmd_access(id ,level ,cid, 1)) {
return PLUGIN_CONTINUE
}
new distance, origin[3], iOrigin[3]
get_user_origin(id, origin, 0)
for( new i = 1; i <get_maxplayers(); i++) {
if( !is_user_connected(i) || id == i) continue
get_user_origin(i, iOrigin, 0)
distance = get_distance(origin, iOrigin)
if( distance <= get_cvar_num("sheild_radius") ) {
new iRed = random_num(0, 255)
new iBlue = random_num(0, 255)
new iGreen = random_num(0, 255)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(1) // TE_BEAMPOINT
write_short(id)
write_coord(iOrigin[0])
write_coord(iOrigin[1])
write_coord(iOrigin[2])
write_short(mXBeam)
write_byte(0)
write_byte(10)
write_byte(10)
write_byte(30)
write_byte(5)
write_byte(iRed)
write_byte(iBlue)
write_byte(iGreen)
write_byte(200)
write_byte(15)
message_end()
user_kill(i, 1) //ZOMG I GOT ELECTRICUTED!!!!!
}
}
return PLUGIN_HANDLED
}
__________________