Raised This Month: $ Target: $400
 0% 

[FXM]Flameshooting XM1014


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-27-2013 , 10:57   [FXM]Flameshooting XM1014
Reply With Quote #1

Here is my new plugin I am trying for...

can someone make damage taken by FXM and add an explosion when FXM Projectile collides with a wall or a player...
Also can i provide a trail for FXM projectile( no with TE_BEAMFOLLOW, but with a flame)
Attached Files
File Type: sma Get Plugin or Get Source (fxm.sma - 144 views - 4.4 KB)
File Type: zip FXM_MODELS.zip (237.7 KB, 55 views)
__________________

Last edited by ezio_auditore; 12-28-2013 at 03:20.
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
DavidJr
Senior Member
Join Date: Apr 2012
Old 12-27-2013 , 11:09   Re: [FXM]Flameshooting XM1014
Reply With Quote #2

About explosion, you can use register_touch like this:

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_touch("fxm_profectile""player""fwd_Touch")
    
register_touch("fxm_profectile""worldspawn""fwd_Touch")
    
// Add your code here...
}

public 
fwd_Touch(entid)
{
    new 
szClassname[33]
    
entity_get_string(entEV_SZ_classnameszClassname)
    
    if (
equal(szClassname"fxm_profectile")
    {
        new 
Float:iOrigin[3], fOrigin[3]
        
entity_get_vector(idEV_VEC_originiOrigin)
        
FVecIVec(iOriginfOrigin)
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYfOrigin)
        
write_byte(TE_EXPLOSION)
        
write_coord(fOrigin[0])
        
write_coord(fOrigin[1])
        
write_coord(fOrigin[2])
        
write_short(explode)
        
write_byte(30)
        
write_byte(15)
        
write_byte(0)
        
message_end()
    }

__________________
What are you looking for here?

Last edited by DavidJr; 12-28-2013 at 04:37.
DavidJr is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-28-2013 , 00:58   Re: [FXM]Flameshooting XM1014
Reply With Quote #3

Quote:
Originally Posted by DavidJr View Post
About explosion, you can use register_touch like this:

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_touch("fxm_profectile""player""fwd_Touch")
    
register_touch("fxm_profectile""worldspawn""fwd_Touch")
    
// Add your code here...
}

public 
fwd_Touch(entid)
{
    new 
szClassname[33]
    
entity_get_string(entEV_SZ_classnameszClassname)
    
    if (
equal(szClassname"fxm_profectile")
    {
        new 
Float:iOrigin[3], FloatfOrigin
        entity_get_vector
(idEV_VEC_originiOrigin)
        
FVecIVec(iOriginfOrigin)
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiOrigin)
        
write_byte(TE_EXPLOSION)
        
write_coord(fOrigin[0])
        
write_coord(fOrigin[1])
        
write_coord(fOrigin[2])
        
write_short(explode)
        
write_byte(30)
        
write_byte(15)
        
write_byte(0)
        
message_end()
    }

arguments does not match definition :
PHP Code:
 entity_get_string(entEV_SZ_classnameszClassname
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-28-2013 , 04:28   Re: [FXM]Flameshooting XM1014
Reply With Quote #4

Quote:
Originally Posted by DavidJr View Post
About explosion, you can use register_touch like this:

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_touch("fxm_profectile""player""fwd_Touch")
    
register_touch("fxm_profectile""worldspawn""fwd_Touch")
    
// Add your code here...
}

public 
fwd_Touch(entid)
{
    new 
szClassname[33]
    
entity_get_string(entEV_SZ_classnameszClassname)
    
    if (
equal(szClassname"fxm_profectile")
    {
        new 
Float:iOrigin[3], FloatfOrigin
        entity_get_vector
(idEV_VEC_originiOrigin)
        
FVecIVec(iOriginfOrigin)
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITYiOrigin)
        
write_byte(TE_EXPLOSION)
        
write_coord(fOrigin[0])
        
write_coord(fOrigin[1])
        
write_coord(fOrigin[2])
        
write_short(explode)
        
write_byte(30)
        
write_byte(15)
        
write_byte(0)
        
message_end()
    }

Argument type mismatch <argument 2> :
PHP Code:
FVecIVec(iOriginfOrigin
__________________

Last edited by ezio_auditore; 12-28-2013 at 04:29.
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-27-2013 , 11:10   Re: [FXM]Flameshooting XM1014
Reply With Quote #5

and can this explosion reduce its victim's HP
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
DavidJr
Senior Member
Join Date: Apr 2012
Old 12-27-2013 , 11:15   Re: [FXM]Flameshooting XM1014
Reply With Quote #6

No, you must execute takedamage when it touches the target.
__________________
What are you looking for here?
DavidJr is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-27-2013 , 11:16   Re: [FXM]Flameshooting XM1014
Reply With Quote #7

will it be stock function or public function??
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
DavidJr
Senior Member
Join Date: Apr 2012
Old 12-27-2013 , 11:20   Re: [FXM]Flameshooting XM1014
Reply With Quote #8

Public function is enough, you can put it in fwd_Touch.
__________________
What are you looking for here?
DavidJr is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-27-2013 , 11:24   Re: [FXM]Flameshooting XM1014
Reply With Quote #9

alright got it...

in fwd_touch:
PHP Code:
if (equal(szClassname,"player"))
{
// now how to obtain index of target player

__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
DavidJr
Senior Member
Join Date: Apr 2012
Old 12-27-2013 , 11:28   Re: [FXM]Flameshooting XM1014
Reply With Quote #10

You do not need to obtain the index of the player, already defined in:

PHP Code:
register_touch("fxm_profectile""player""fwd_Touch"
PHP Code:
public fwd_Touch(entid//ent is index of fxm_profectile and id is index of player 
__________________
What are you looking for here?
DavidJr is offline
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 10:05.


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