AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Set Damage To Entity + Disable Bool (https://forums.alliedmods.net/showthread.php?t=261048)

Zaidbt 04-05-2015 10:23

[Help] Set Damage To Entity + Disable Bool
 
Hey =)
Only 1 last day to finish my naruto mod , i have 1 probleme if someone could help

1 SEt Damage To Entity
PHP Code:

#include <amxmodx> 
#include <fun> 
#include <engine> 
#include <fakemeta> 

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "EaGle"

new frostsprite;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_CmdStart"fw_Start")
    
}
public 
plugin_precache()
{
    
frostsprite precache_model"sprites/fire_nade.spr" 
}
public 
fw_Start(iduc_handleseed

    new 
button get_uc(uc_handle,UC_Buttons
    
    if((
button IN_ATTACK2)) 
    {
        
use_cmd(id
    }
}   

public 
use_cmd(player

    
    new 
targetbody 
    get_user_aiming
playertargetbody1000
    
    if( 
is_user_alivetarget )) 
    { 
        
sprite_controlplayer 
    } 
    return 
PLUGIN_HANDLED 


public 
sprite_controlplayer 

    new 
vec
    new 
aimvec
    new 
velocityvec
    new 
length 
    
new speed 10 
    
    get_user_origin
playervec 
    
get_user_originplayeraimvec
    
    
velocityvec] = aimvec] - vec
    
velocityvec] = aimvec] - vec
    
velocityvec] = aimvec] - vec
    
length sqrtvelocityvec] * velocityvec] + velocityvec] * velocityvec] + velocityvec] * velocityvec] ) 
    
velocityvec] = velocityvec] * speed length 
    velocityvec
] = velocityvec] * speed length 
    velocityvec
] = velocityvec] * speed length 
    
    
new args
    
args] = vec
    
args] = vec
    
args] = vec
    
args] = velocityvec
    
args] = velocityvec
    
args] = velocityvec
    
    
set_task0.1"te_spray"0args8"a"
        

public 
te_sprayargs[ ] ) 

    
message_beginMSG_BROADCAST,SVC_TEMPENTITY 
    
write_byte120 // Throws a shower of sprites or models 
    
write_coordargs] ) // start pos 
    
write_coordargs] ) 
    
write_coordargs] ) 
    
write_coordargs] ) // velocity 
    
write_coordargs] ) 
    
write_coordargs] ) 
    
write_shortfrostsprite // spr 
    
write_byte// count 
    
write_byte70 // speed 
    
write_byte100 //(noise) 
    
write_byte// (rendermode) 
    
message_end( ) 

    return 
PLUGIN_CONTINUE 

public 
sqrtnum 

    new 
div num 
    
new result 
    
while( div result 
    { 
        
div = ( div result ) / 
        result 
num div 
    

    return 
div 

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/ 

What to do if we want that the target receive Damages from the fire of the entity ?

thank you

Shiina.Mashiro 04-05-2015 12:36

Re: [Help] Set Damage To Entity + Disable Bool
 
I don't see you're creating any entity for this.

Zaidbt 04-05-2015 13:06

Re: [Help] Set Damage To Entity + Disable Bool
 
It's not mine . It kinda create an Spr ( Fire ) . But i need it to make damage to the aimed player Pls ? :P ty

Freezo Begin 04-06-2015 08:04

Re: [Help] Set Damage To Entity + Disable Bool
 
Yes we know that its a Sprite , but u need to create an entity for it ! to detect it in a touch event ...

Zaidbt 04-06-2015 15:47

Re: [Help] Set Damage To Entity + Disable Bool
 
More infos plz ? i didnt understand


All times are GMT -4. The time now is 07:38.

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