Raised This Month: $ Target: $400
 0% 

Healing Totem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Vertricus
Junior Member
Join Date: Aug 2009
Location: Poland>Śląs
Old 08-06-2009 , 06:26   Healing Totem
Reply With Quote #1

This is standard piece of code of healing totem which is in polish version of diablomod.
Quote:
public Effect_Healing_Totem_Think(ent)
{
new id = pev(ent,pev_owner)
new totem_dist = 300
new amount_healed = player_b_heal[id]

//We have emitted beam. Apply effect (this is delayed)
if (pev(ent,pev_euser2) == 1)
{
new Float:forigin[3], origin[3]
pev(ent,pev_origin,forigin)
FVecIVec(forigin,origin)

//Find people near and damage them
new entlist[513]
new numfound = find_sphere_class(0,"player",totem_dist+0.0,e ntlis t,512,forigin)

for (new i=0; i < numfound; i++)
{
new pid = entlist[i]

if (get_user_team(pid) != get_user_team(id))
continue


if (is_user_alive(pid) && get_user_health(pid) + amount_healed < race_heal[player_class[pid]]+player_strength[pid]*2)
set_user_health(pid,get_user_health(pid)+amou nt_he aled)
else
set_user_health(pid,race_heal[player_class[pid]]+player_strength[pid]*2)
}


set_pev(ent,pev_euser2,0)
set_pev(ent,pev_nextthink, halflife_time() + 1.5)

return PLUGIN_CONTINUE
}


//Entity should be destroyed because livetime is over
if (pev(ent,pev_ltime) < halflife_time() || !is_user_alive(id))
{
remove_entity(ent)
return PLUGIN_CONTINUE
}



//If this object is almost dead, apply some render to make it fade out
if (pev(ent,pev_ltime)-2.0 < halflife_time())
set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 )



new Float:forigin[3], origin[3]
pev(ent,pev_origin,forigin)
FVecIVec(forigin,origin)



//Find people near and give them health
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] );
write_coord( origin[0] );
write_coord( origin[1] + totem_dist );
write_coord( origin[2] + totem_dist );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 ); // r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 5 ); // speed
message_end();

//Time till we apply totems effect

set_pev(ent,pev_euser2,1)
set_pev(ent,pev_nextthink, halflife_time() + 0.5)


return PLUGIN_CONTINUE

}

I'm trying to edit this totem.
I don't want that it's heal player's which has player_item_id[id] != 17.
Quote:
if (is_user_alive(pid) && player_item_id[id] != 17 && get_user_health(pid) + amount_healed < race_heal[player_class[pid]]+player_strength[pid]*2)
set_user_health(pid,get_user_health(pid)+amou nt_he aled)
else
set_user_health(pid,race_heal[player_class[pid]]+player_strength[pid]*2)
}
I add it here but I know that id=id of owner the totem.
Can someone help me and say what I must write
Quote:
&& player_item_id[id] != 17
there?
Vertricus is offline
Send a message via Skype™ to Vertricus
 



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 18:29.


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