Raised This Month: $ Target: $400
 0% 

explosion script help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-05-2007 , 09:12   explosion script help
Reply With Quote #1

hi,
I maked this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
 
 
new const PLUGIN[] = "Explosive Flashbangs"
new const VERSION[] = "0.1.0"
new const AUTHOR[] = "SAMURAI"
 
#define TE_EXPLOSION 3
new explode;
 
new 
pCvar;
 
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
pCvar register_cvar("explosive_flashbangs","1");
 
register_forward(FM_EmitSound,"fw_emitsound");
}
 
public 
plugin_precache()
{
 
explode precache_model("sprites/explode1.spr");
}
 
public 
fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)
{
 if( !
get_pcvar_num(pCvar) && !equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav") )
  return 
FMRES_IGNORED;
 
flashbang_explode(entity);
 return 
FMRES_IGNORED;
}
 
public 
flashbang_explode(greindex)
{
 if(!
pev_valid(greindex)) return;
 new 
Float:origin[3];
 
pev(greindex,pev_origin,origin);
 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY); 
 
write_byte(TE_EXPLOSION);
 
write_coord(floatround(origin[0])); 
 
write_coord(floatround(origin[1]));   
 
write_coord(floatround(origin[2]));
 
 
write_short(explode); 
 
 
write_byte(80); 
 
write_byte(10); 
 
write_byte(0); 
 
 
message_end(); 
 

If can somebody implement to take damage because my plugin is only a fake explosion. So i need to implement to take damage on players (a fake damage )
hope you are understand

Thanks

Last edited by SAMURAI16; 02-05-2007 at 09:14.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-05-2007 , 09:59   Re: explosion script help
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <fakemeta_util> new const PLUGIN[] = "Explosive Flashbangs" new const VERSION[] = "0.1.0" new const AUTHOR[] = "SAMURAI" #define TE_EXPLOSION 3 new explode; new g_MaxPlayers new pCvar; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     pCvar = register_cvar("explosive_flashbangs","1");     register_forward(FM_EmitSound,"fw_emitsound");     g_MaxPlayers = get_maxplayers() } public plugin_precache() {     explode = precache_model("sprites/explode1.spr"); } public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch) {     if( !get_pcvar_num(pCvar) && !equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav") )         return FMRES_IGNORED;     flashbang_explode(entity);     return FMRES_IGNORED; } public flashbang_explode(greindex) {     if(!pev_valid(greindex)) return;     new Float:origin[3];     pev(greindex,pev_origin,origin);         message_begin( MSG_BROADCAST,SVC_TEMPENTITY);     write_byte(TE_EXPLOSION);     write_coord(floatround(origin[0]));     write_coord(floatround(origin[1]));       write_coord(floatround(origin[2]));         write_short(explode);         write_byte(80);     write_byte(10);     write_byte(0);         message_end();         flashbang_damage(origin, "flashbang", ..., ...) }   public flashbang_damage(Float:origin[3], const classname[], Float:damage, Float:range) {         new Float:pOrigin[3]     new Float:dist     new Float:tmpdmg         for(new i = 1; i < g_MaxPlayers; i++) {         if(is_user_alive(i)) {             pev(i,pev_origin,pOrigin)             dist = get_distance_f(origin,pOrigin)                         if(dist <= range) {                 tmpdmg = damage-(damage/range)*dist                 fm_fakedamage(i, classname, tmpdmg, DMG_BLAST)             }         }     } }

Last edited by [ --<-@ ] Black Rose; 02-05-2007 at 11:47.
[ --<-@ ] Black Rose is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-05-2007 , 10:06   Re: explosion script help
Reply With Quote #3

perfect thanks
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-05-2007 , 10:30   Re: explosion script help
Reply With Quote #4

i got an error here:
Code:
flashbang_damage(origin, "flashbang", ..., ...)

How shoud like complete ?
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-05-2007 , 10:32   Re: explosion script help
Reply With Quote #5

You will have to add that urself, damage and radius.
Like 40.0 and 50.0 maby.
[ --<-@ ] Black Rose is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-05-2007 , 14:54   Re: explosion script help
Reply With Quote #6

so here :
Code:
flashbang_damage(origin, "flashbang", ..., ...)

arg 2 required an class const name[] and you used "flashbang" . And if i want to make explosion for an player ? what i must use istead of "flashbang"
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-05-2007 , 15:57   Re: explosion script help
Reply With Quote #7

I think that shows what 'weapon' you got damaged from. ( Not in hud, logs or stats or w/e )

I typed flashbang cuz the flashbang is doing the damage.
[ --<-@ ] Black Rose 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 00:36.


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