AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [FXM]Flameshooting XM1014 (https://forums.alliedmods.net/showthread.php?t=232217)

ezio_auditore 12-27-2013 10:57

[FXM]Flameshooting XM1014
 
2 Attachment(s)
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)

DavidJr 12-27-2013 11:09

Re: [FXM]Flameshooting XM1014
 
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()
    }



ezio_auditore 12-27-2013 11:10

Re: [FXM]Flameshooting XM1014
 
and can this explosion reduce its victim's HP

DavidJr 12-27-2013 11:15

Re: [FXM]Flameshooting XM1014
 
No, you must execute takedamage when it touches the target.

ezio_auditore 12-27-2013 11:16

Re: [FXM]Flameshooting XM1014
 
will it be stock function or public function?? :P

DavidJr 12-27-2013 11:20

Re: [FXM]Flameshooting XM1014
 
Public function is enough, you can put it in fwd_Touch.

ezio_auditore 12-27-2013 11:24

Re: [FXM]Flameshooting XM1014
 
alright got it...

in fwd_touch:
PHP Code:

if (equal(szClassname,"player"))
{
// now how to obtain index of target player



DavidJr 12-27-2013 11:28

Re: [FXM]Flameshooting XM1014
 
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 


ezio_auditore 12-28-2013 00:58

Re: [FXM]Flameshooting XM1014
 
Quote:

Originally Posted by DavidJr (Post 2077055)
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


DavidJr 12-28-2013 02:33

Re: [FXM]Flameshooting XM1014
 
Sorry, it must be
PHP Code:

 entity_get_string(entEV_SZ_classnameszClassnamesizeof szClassname



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

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