Raised This Month: $ Target: $400
 0% 

Radius_Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blue One
Junior Member
Join Date: May 2006
Location: Germany , Sarlhusen
Old 01-31-2007 , 15:23   Radius_Damage
Reply With Quote #1

hey guys i got some problems with my script , i dont know how i can configurate my Radiusdamage . I want that if i kill an Enemy that an little Explosion comes out of him . but nothing i dont know how i configurate the Radius Damage

Can anyone show me an example

with Player die public ? Please help me
__________________
Scripter of the ; Lord of the Rings and Hunter/Hunted Mod

iam search some Testers here

Helpfulideas was been Sponsored of Peoples of my 10th Schoolclass in Germany.... Big Thanks here
Blue One is offline
Send a message via ICQ to Blue One Send a message via MSN to Blue One
godlike
Senior Member
Join Date: Apr 2005
Old 01-31-2007 , 15:31   Re: Radius_Damage
Reply With Quote #2

I really dont know how to script but try to look in the source of warcraft3 the suicede bomber thingy.
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-31-2007 , 16:37   Re: Radius_Damage
Reply With Quote #3

Code:
public radiusdamage(id){
new origin[3]
new damage = 50 //50 hp damage
new radius = 100 //radius is within 100 units
get_user_origin(id,origin)
radius_damage(origin,75,35)
}
Note that if it kills a person then the kill will show as suicide.
So the function i would use is this:
Code:
public radiusdamage(id){ new pnum = get_playersnum() for(new a = 1; a <= pnum; a++) { if(userinradius(a,id)){ console_print(a,"you are in the radius!") } } } public userinradius(a,id){ new distanceBetween new origin1[3], origin[3] new dmgRadius = 100 get_user_origin(id, origin) if ( is_user_alive(a) && a != id) { get_user_origin(a, origin1) distanceBetween = get_distance(origin, origin1) if ( distanceBetween < dmgRadius ) { return 1 } } return 0 }

This way, you can determine your own deathmessage.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 01-31-2007 , 17:34   Re: Radius_Damage
Reply With Quote #4

well i wrote a dynamic native for my plugins long time ago.
Code:
//... somewhere in your *.inc file native radiusDamage( Entity, DeathMsg[], Float:MaxDamage, Float:MaxRadius, Float:MaxDamageRadius, IgnoreEntity = 0 ); //... public plugin_natives() register_native( "radiusDamage"                , "__RadiusDamage" ); //... somewhere in your code public __RadiusDamage( Plugin ) {     static iEntity;     iEntity = get_param(1);         static Classname[64];     get_string( 2, Classname, 63 );         static Float:fMaxDamage;     fMaxDamage = get_param_f( 3 );         static Float:MaxRadius;     MaxRadius = get_param_f( 4 );         static Float:iRadius;     iRadius = get_param_f( 5 );         static IgnoreEntity;     IgnoreEntity = get_param(6);         static Float:vExplodeAt[3], Float:damage, Float:origin1[3];     pev(iEntity, pev_origin, vExplodeAt);         static Float:multiplier, Float:distanceBetween;     static maxClients;     maxClients = global_get( glb_maxClients );         static Float:hp;                         new owner = pev(iEntity, pev_owner );     iEntity = owner ? owner : iEntity;         for(new id = 1; id <= maxClients ; id++)     {         if( pev_valid(id)          && is_user_alive(id)          && IgnoreEntity != id          && ( get_pcvar_num( CVAR_FriendlyFire ) || getClientTEAM( iEntity ) != getClientTEAM( id ) )           )         {             pev(id, pev_origin, origin1);             distanceBetween = get_distance_f(vExplodeAt, origin1 );                         if( distanceBetween <= MaxRadius )             {                 multiplier = ( fMaxDamage * fMaxDamage ) / iRadius;                 damage = ( iRadius - distanceBetween ) * multiplier;                 damage = floatsqroot( damage );                 pev( id, pev_health, hp );                 hp -= damage;                 if( hp <= 0 )                 {                     silentClientKILL( id );                     message_begin    ( MSG_ALL, MSG_DeathMsg, { 0, 0, 0 }, 0 );                     write_byte    ( iEntity );                     write_byte    ( id );                     write_string    ( Classname );                     message_end    ();                 }                 else                 {                     set_pev( id, pev_health, hp );                     message_begin    ( MSG_ONE, MSG_Health, {0,0,0} , id );                     write_byte    ( floatround(hp) );                     message_end    ();                 }                                 }         }     }     }

iEntity = Entity who does damage. If it has an owner, the owner will be used for the DeathMsg
DeathMsg = The weapon that will be displayed
MaxDamage = the max damage that a client will get
MaxRadius = Inside of this radius the client will get damage. How much depends on the distance to the explosion core
MaxDamageRadius = If a player is inside of this radius the client will get the maxdamage
IgnoreEntity = this entity will not get any damage.

NOTE: This code contains functions that are not in included in amxx. So you have to port this function first b4 you can use it.

getClientTEAM = returns TeamID of the player
silentClientKILL = kills a player without score-/deathmessages
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
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:38.


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