Code:
public beacon(id)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
if(is_user_alive(id))
{
static origin[3]
get_user_origin(id, origin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMCYLINDER) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]-20) // z
write_coord(origin[0]) // x axis
write_coord(origin[1]) // y axis
write_coord(origin[2]+200) // z axis
write_short(beacon_sprite) // sprite
write_byte(0) // startframe
write_byte(1) // framerate
write_byte(6) // life
write_byte(2) // width
write_byte(1) // noise
write_byte(0) // red
write_byte(0) // green
write_byte(250) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
}
}
else
{
if(is_user_alive(id))
{
static origin[3]
get_user_origin(id, origin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMCYLINDER) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]-20) // z
write_coord(origin[0]) // x axis
write_coord(origin[1]) // y axis
write_coord(origin[2]+200) // z axis
write_short(beacon_sprite) // sprite
write_byte(0) // startframe
write_byte(1) // framerate
write_byte(6) // life
write_byte(2) // width
write_byte(1) // noise
write_byte(250) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
}
}
set_task(1.0, "beacon", id)
}
Code:
L 06/17/2012 - 03:31:44: [CSTRIKE] Invalid player 1
L 06/17/2012 - 03:31:44: [AMXX] Displaying debug trace (plugin "jb_days_lr.amxx")
L 06/17/2012 - 03:31:44: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 06/17/2012 - 03:31:44: [AMXX] [0] jb_days_lr.sma::beacon (line 706)
I saw this warning in logs, so i added to code that is_user_alive(id) thing, but even after that i have same problem. So how do i fix this?
this code is a part of this plugin
http://forums.alliedmods.net/showthread.php?t=117992