Alright I'm trying to make it so when the fireball touches a player the player gets killed. However.. with the way the plugin is currently setup the player gets killed by every entity. Can someone provide any help my brain is about to explode:
Code:
// Global Variables
new SpriteExorcise
new fireball
//-------------------------------------------------------------------------------------------------------
// Declaring info variables
new PLUGIN[]="Requiem"
new AUTHOR[]="CubicVirtuoso"
new VERSION[]="1.01"
//-------------------------------------------------------------------------------------------------------
// initalize function
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR) // Register Function
register_concmd("req_healother", "inter_healother", ADMIN_SLAY, "<target> ") // Register Interactive Heal other Command
register_concmd("req_exorcise", "combat_exorcise", ADMIN_SLAY, "<target> ") // Register Combat Exorcise Command
register_concmd("req_pentacost", "combat_pentacost", ADMIN_SLAY, "") // Register Combat Pentacost Command
}
//-------------------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_sound("ambience/zapmachine.wav") // Precaches holy sound
precache_sound("nihilanth/nil_thieves.wav") // Precaches death sound
precache_model("sprites/xfireball3.spr") // Pentacost ball
SpriteExorcise = precache_model("sprites/redflare1.spr") // Precaches exorcise
}
//-------------------------------------------------------------------------------------------------------
/* Combat - Penatcost
Admin can shoot a fireball from where they are standing gibbing everything in its path
INPUT: id = users id, level = access level of the command, cid = command's internal id
OUTPUT: Plugin Handled */
public combat_pentacost(id, level, cid)
{
if (!cmd_access(id, level, cid, 2)) // Checks if the command user has access
return PLUGIN_HANDLED
new startpoint[3] // users current location
new endpoint[3] // users looking location
get_user_origin(id,startpoint) // set location
get_user_origin(id, endpoint, 2) // set location
new Float:EndVec[3]
IVecFVec(endpoint, EndVec)
new Float:StartVec[3]
IVecFVec(startpoint, StartVec)
new Float:VeloVec[3]
VeloVec[0] = (EndVec[0] - StartVec[0])*1
VeloVec[1] = (EndVec[1] - StartVec[1])*1
VeloVec[2] = (EndVec[2] - StartVec[2])*1
fireball = create_entity("info_target")
if(!fireball)
return PLUGIN_HANDLED
entity_set_string(fireball, EV_SZ_classname, "pentacost_ball")
entity_set_edict(fireball, EV_ENT_owner, id)
entity_set_int(fireball, EV_INT_movetype, 11)
entity_set_int(fireball, EV_INT_solid, SOLID_NOT)
set_rendering(fireball, kRenderFxNoDissipation, 255, 0, 0, kRenderGlow, 200)
entity_set_model(fireball, "sprites/redflare1.spr")
entity_set_origin(fireball, StartVec)
entity_set_vector(fireball, EV_VEC_velocity, VeloVec)
return PLUGIN_HANDLED
}
//-------------------------------------------------------------------------------------------------------
public pfn_touch(ptr,ptd)
{
if(ptr==fireball) //Check to see if the toucher is fireball
{
if(ptd<=32 && is_user_alive(ptd)) //Check to see if the touched is a player and alive
{
fakedamage(ptd,"Pentacost",2000.0,DMG_BLAST)
}
}
if(ptd==fireball) //Check to see if the fireball IS BEING TOUCHED
{
if(ptr<=32 && is_user_alive(ptr)) //Check to see if the toucher is a player and is alive
{
fakedamage(ptr,"Pentacost",2000.0,DMG_BLAST)
}
}
return PLUGIN_CONTINUE
}
//-------------------------------------------------------------------------------------------------------