Raised This Month: $ Target: $400
 0% 

Explosion Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-11-2009 , 07:48   Explosion Help
Reply With Quote #1

How would i go about writing a function that will cause an explosion around x radious killing the index and those around.

This is all i have found so far

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

public plugin_init() {
 
register_plugin("Suicide Bomber""1.0""Shadow Warrior")
 
 
//register_logevent("random_player", 2, "1=Round_Start")
 
 
RegisterHam(Ham_Spawn"player""random_player"1)
}
public 
random_player(id)
{
 new 
players[32], totalplayersrandplayerpass;
 
get_players(playerstotalplayers)
 if (!
randplayer)
 
randplayer random_num(1totalplayers)
 if(!
is_user_connected(randplayer) || !is_user_alive(randplayer))
 {
  
set_task(0.1"random_player")
  return 
PLUGIN_HANDLED
 
}
 if(
pass == 1)
 return 
PLUGIN_HANDLED
 pass 
1
 suicide_bomb
(id);
 
 return 
PLUGIN_HANDLED
}  
public 
suicide_bomb(id){
 
 
//BOOM CODE lol
 

Doc-Holiday is offline
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-11-2009 , 09:02   Re: Explosion Help
Reply With Quote #2

Quote:
How would i go about writing a function that will cause an explosion around x radious killing the index and those around.

This is all i have found so far
What?
X0Left4dead0X is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-11-2009 , 11:50   Re: Explosion Help
Reply With Quote #3

Quote:
Originally Posted by X0Left4dead0X View Post
What?
Well that was a smart post? He wants a function that will cause an explosion where the player is and kill the player and people around him. Ofc the function should get player id when it's called.
SnoW is offline
Send a message via MSN to SnoW
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-11-2009 , 14:26   Re: Explosion Help
Reply With Quote #4

PHP Code:
public BlowUp(id)
{
    new 
Float:dRatiodamagedistanceBetween
    
new damradius get_cvar_num("kam_radius")
    new 
maxdamage get_cvar_num("kam_maxdamage")
    
IsKam[id] = 0

    
new name[32]
    
get_user_name(id,name,31)
    
shUnglow(id)
    
set_hudmessage(01002000.050.6520.021.00.010.185)
    
show_hudmessage(0,"%s Has Blew you up",name)
    new 
FFOn get_cvar_num("mp_friendlyfire")
    new 
origin[3], origin1[3]
    
get_user_origin(id,origin)

    
explode(origin// blowup even if dead

    
for(new 1<= SH_MAXSLOTSa++) {
        if( 
is_user_alive(a) && ( get_user_team(id) != get_user_team(a) || FFOn || == id ) ) {

            
get_user_origin(a,origin1)

            
distanceBetween get_distance(originorigin1 )
            if( 
distanceBetween damradius ) {
                if ( 
== id ) {
                    
damage maxdamage 4
                
}
                else {
                    
dRatio float(distanceBetween) / float(damradius)
                    
damage maxdamage floatroundmaxdamage dRatio)
                }
                
shExtraDamage(aiddamage"Kamamakarzi")
            } 
// distance
        
// alive
    
// loop

PHP Code:
public explodevec1[3] )
{
    
// blast circles
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1)
    
write_byte21 )
    
write_coord(vec1[0])
    
write_coord(vec1[1])
    
write_coord(vec1[2] + 16)
    
write_coord(vec1[0])
    
write_coord(vec1[1])
    
write_coord(vec1[2] + 1936)
    
write_shortwhite )
    
write_byte// startframe
    
write_byte// framerate
    
write_byte// life 2
    
write_byte20 // width 16
    
write_byte// noise
    
write_byte188 // r
    
write_byte220 // g
    
write_byte255 // b
    
write_byte255 //brightness
    
write_byte// speed
    
message_end()

    
//Explosion2
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte12 )
    
write_coord(vec1[0])
    
write_coord(vec1[1])
    
write_coord(vec1[2])
    
write_byte188 // byte (scale in 0.1's) 188
    
write_byte10 // byte (framerate)
    
message_end()

    
//TE_Explosion
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1)
    
write_byte)
    
write_coord(vec1[0])
    
write_coord(vec1[1])
    
write_coord(vec1[2])
    
write_shortfire )
    
write_byte60 // byte (scale in 0.1's) 188
    
write_byte10 // byte (framerate)
    
write_byte// byte flags
    
message_end()

    
//Smoke
    
message_beginMSG_BROADCAST,SVC_TEMPENTITY,vec1)
    
write_byte// 5
    
write_coord(vec1[0])
    
write_coord(vec1[1])
    
write_coord(vec1[2])
    
write_shortsmoke )
    
write_byte10 )  // 2
    
write_byte10 )  // 10
    
message_end()


PHP Code:
new smokewhitefire
new Iskam[33
PHP Code:
 smoke precache_model("sprites/smoke.spr")
    
white precache_model("sprites/zerogxplode.spr")
    
fire precache_model("sprites/cexplo.spr"

Last edited by X0Left4dead0X; 01-11-2009 at 14:28.
X0Left4dead0X is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-11-2009 , 17:20   Re: Explosion Help
Reply With Quote #5

ok so if i wanted him to have 250 life 250 armor could i use the random player to do the following

PHP Code:
 health register_cvar("amx_bomber_health""250")
 
armor register_cvar("amx_bomber_armor""250"
PHP Code:
 
public suicide_bomber(id)
{
 if(
is_user_alive(id)
 {
  
cs_set_user_model(id"vip")
  
set_user_health(idget_pcvar_num(health))
  
set_user_armor(idget_pcvar_num(armor))
  
BlowUp(id);
  return 
PLUGIN_CONTINUE
 
}


Last edited by Doc-Holiday; 01-11-2009 at 17:26.
Doc-Holiday is offline
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-11-2009 , 18:09   Re: Explosion Help
Reply With Quote #6

PHP Code:
public suicide_bomber(id)
{
 if(
is_user_alive(id)
 {
  
cs_set_user_model(id"vip")
  
set_user_health(idhealth)
  
set_user_armor(idarmor)
  
BlowUp(id);
  return 
PLUGIN_CONTINUE
 
}

X0Left4dead0X is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-11-2009 , 18:29   Re: Explosion Help
Reply With Quote #7

Im not a good coder but what is this?

shExtraDamage(a, id, damage, "Kamamakarzi")
Doc-Holiday is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 01-11-2009 , 18:55   Re: Explosion Help
Reply With Quote #8

Quote:
Originally Posted by NcB_Sav View Post
Im not a good coder but what is this?

shExtraDamage(a, id, damage, "Kamamakarzi")
Lol that's from SuperHero Mod :\
__________________
IneedHelp is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-12-2009 , 05:30   Re: Explosion Help
Reply With Quote #9

The cs_jetpack plugin has a fairly in-depth explosion to it that I can help explain to you if you need help. It deals damage based on a radius (the equation is probably not completely correct, but it works for me ), checks for friendly fire, kills the person in the middle every time, adds points to the person that caused the explosion, etc.

http://forums.alliedmods.net/attachm...8&d=1231736014
__________________
Bad_Bud is offline
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-12-2009 , 11:41   Re: Explosion Help
Reply With Quote #10

Quote:
Originally Posted by Bad_Bud View Post
The cs_jetpack plugin has a fairly in-depth explosion to it that I can help explain to you if you need help. It deals damage based on a radius (the equation is probably not completely correct, but it works for me ), checks for friendly fire, kills the person in the middle every time, adds points to the person that caused the explosion, etc.

http://forums.alliedmods.net/attachm...8&d=1231736014
I guess he could use that for the explosion. My code is for Counter-strike Leeroy Jenkins Completly Different Amxx and superhero
X0Left4dead0X 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 01:43.


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