AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damageradius like seen in Gasnades für players. (https://forums.alliedmods.net/showthread.php?t=51325)

Noizza 02-15-2007 21:26

Damageradius like seen in Gasnades für players.
 
Hi!

I need a little help with my plugin.

I want a player to glow yellow and do 5dmg per second to alle players next to him (radius like grenade).

glowing is no problem^^
but how do i make him damage to outer players in his radius?

thx

Ryu2877 02-15-2007 23:33

Re: Damageradius like seen in Gasnades für players.
 
personal idea
1) create a invisible enitity, solid_trigger
2) set it's size to fit the "radius"
3) set it's origin to the player's origin & set it follow "the player"(movetype_follow)
4) when other players touch the created entity, use some trace-line to filtrate "wall" | "water" etc, then the residual status is been "hurt", just make "fakedamage" to them
5) if you want damage per some seconds, chang some param of the created entity by every "think" of it(through set the created entity's "nextthink" by your custom time), or simply use loop task
sorry for my bad English.

XxAvalanchexX 02-16-2007 00:21

Re: Damageradius like seen in Gasnades für players.
 
Engine:
Code:
new ent, Float:origin[3], Float:radius = 256.0; entity_get_vector(id,EV_VEC_origin,origin); while((ent = find_ent_in_sphere(ent,origin,radius)) != 0) {      if(!is_user_connected(ent))           continue;      // damage "ent" here }

Fakemeta:
Code:
new ent, Float:origin[3], Float:radius = 256.0; pev(id,pev_origin,origin); while((ent = engfunc(EngFunc_FindEntityInSphere,ent,origin,radius)) != 0) {      if(!is_user_connected(ent))           continue;      // damage "ent" here }

Noizza 02-16-2007 19:32

Re: Damageradius like seen in Gasnades für players.
 
Thank you!

But...
I startet coding this plugin 2004....
I found it yesterday an looked at its code...
The i realized that i´ve forgot everything i know about coding plugins ;)

So your answer IS really helpful, BUT i dont know how i put this into my plugin ;)

this is my code so far...

Code:

public racost(id) {
        if(!is_user_alive(id))
                {
                client_print(id,print_chat,"[BCM] Tote Menschen brauchen kein Uran^^.")
                return PLUGIN_HANDLED
        }
        new money,cost
        money = cs_get_user_money(id)
        cost = get_cvar_num("buy_racost")
        if( money < cost) {
                client_print(id,print_chat,"[BCM] Du hast nicht genug Geld. Der Cheat kostet: $%i",cost)
                return PLUGIN_HANDLED
        }
        if( money > cost) {
                new money,cost
                money = cs_get_user_money(id)
                cost = get_cvar_num("buy_racost")
                new name[35]
               
                get_user_name(id,name,34)
                client_print(0,print_chat,"[BCM] %s ist radioaktiv verseucht!",name)
                cs_set_user_money(id,(money - cost),1)
                set_user_rendering(id,kRenderFxGlowShell,255,255,0,kRenderNormal,25)
        }
        return PLUGIN_HANDLED
}



All times are GMT -4. The time now is 00:37.

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