Post by ShaunCraft15 on Jun 2, 2023 20:18:25 GMT
Hello Again, i tried many times how i can create an plugin like this, idk why i am lucky at this??
Here the code
Enjoy
Here the code
Enjoy
#include <amxmodx>
#include <zp50_core>
#include <fakemeta>
#include <engine>
const TASK_BEAM = 100
new const szSprite[] = "sprites/laserbeam.spr"
new fSprite, Float:fLastHumanOrigin[3]
public plugin_init()
{
register_plugin("[ZP50]: Last Human Beam", "1.0", "ShaunCraft")
}
public plugin_precache()
fSprite = precache_model(szSprite)
public zp_fw_core_last_human(this)
entity_get_vector(this, EV_VEC_origin, fLastHumanOrigin)
public client_putinserver(this)
set_task(0.1, "TaskBeam", this+TASK_BEAM, _, _, "b")
public TaskBeam(fTaskID)
{
new fIndex = fTaskID - TASK_BEAM
if(zp_core_get_human_count() != 1 || !zp_core_is_zombie(fIndex))
return;
static Float:fOrigin[3]
entity_get_vector(fIndex, EV_VEC_origin, fOrigin)
CreateLastHumanTracer(fIndex, fOrigin, fLastHumanOrigin)
}
public CreateLastHumanTracer(this, Float:fOrigin[3], Float:fOrigin2[3])
{
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, {0,0,0}, this)
write_byte(0)
engfunc(EngFunc_WriteCoord, fOrigin[0])
engfunc(EngFunc_WriteCoord, fOrigin[1])
engfunc(EngFunc_WriteCoord, fOrigin[2])
engfunc(EngFunc_WriteCoord, fOrigin2[0])
engfunc(EngFunc_WriteCoord, fOrigin2[1])
engfunc(EngFunc_WriteCoord, fOrigin2[2])
write_short(fSprite)
write_byte(1)
write_byte(1)
write_byte(1)
write_byte(33)
write_byte(0)
write_byte(10)
write_byte(10)
write_byte(255)
write_byte(255)
write_byte(150)
message_end()
}