Raised This Month: $51 Target: $400
 12% 

Everything Kills me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-05-2005 , 14:16   Everything Kills me
Reply With Quote #1

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 } //-------------------------------------------------------------------------------------------------------
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
D_Hawk
Veteran Member
Join Date: Apr 2005
Location: No
Old 08-05-2005 , 14:19  
Reply With Quote #2

Whoa... first of all use tags. Makes it a lot easier to read.
__________________
User has abandoned this account.
D_Hawk is offline
Send a message via ICQ to D_Hawk Send a message via AIM to D_Hawk Send a message via MSN to D_Hawk Send a message via Yahoo to D_Hawk
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-05-2005 , 14:22  
Reply With Quote #3

There sorry

Problem has been fixed... I had to add fireball = -1 to the top.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
smdobay
Member
Join Date: Feb 2005
Old 08-05-2005 , 16:06  
Reply With Quote #4

Alright.

Replace this first line in your pfn_touch:
Code:
if(ptr==fireball)    //Check to see if the toucher is fireball     {

with this:

Code:
if (is_valid_ent(ptd) && is_valid_ent(ptr) && is_user_connected(ptd)) {         new ptr_classname[32]         entity_get_string(ptr, EV_SZ_classname, ptr_classname, 31)                 if (!equal(ptr_classname, "pentacost_ball")) return PLUGIN_CONTINUE
__________________
My karma ran over your dogma


+Karma if I helped
smdobay is offline
D_Hawk
Veteran Member
Join Date: Apr 2005
Location: No
Old 08-05-2005 , 16:09  
Reply With Quote #5

Quote:
Originally Posted by smdobay
Alright.

Replace this first line in your pfn_touch:
Code:
if(ptr==fireball)    //Check to see if the toucher is fireball     {

with this:

Code:
if (is_valid_ent(ptd) && is_valid_ent(ptr) && is_user_connected(ptd)) {         new ptr_classname[32]         entity_get_string(ptr, EV_SZ_classname, ptr_classname, 31)                 if (!equal(ptr_classname, "pentacost_ball")) return PLUGIN_CONTINUE
He already said he fixed it...
__________________
User has abandoned this account.
D_Hawk is offline
Send a message via ICQ to D_Hawk Send a message via AIM to D_Hawk Send a message via MSN to D_Hawk Send a message via Yahoo to D_Hawk
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode