Raised This Month: $ Target: $400
 0% 

Create shield entity to block damage?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-17-2011 , 02:02   Create shield entity to block damage?!
Reply With Quote #1

Hi! That entity trying to make a shield for the player.

Is a model of the shield (attached below).

I have the server will be the VIP players. Each round they will get a shield. This panel will have 500-700 to block the loss of life and in the back until the break. Upon receipt of damage or destruction of the shield should be given a sound yet.

Who is able to help? The task will be interesting and useful for beginners who read the topic. I myself have recently started working with the objects themselves.

Here is my code to create a shield:
but it just hangs the shield on the back of the player without blocking the damage and not getting hit.
PHP Code:
public set_vip_shield(id){
    
usr_shield[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
    
set_pev(usr_shield[id], pev_classname"vip_shield")
    
set_pev(usr_shield[id], pev_movetypeMOVETYPE_FOLLOW)
    
set_pev(usr_shield[id], pev_solid1)
    
set_pev(usr_shield[id], pev_aimentid)
    
set_pev(usr_shield[id], pev_health,100)
    
set_pev(usr_shield[id], pev_rendermodekRenderNormal)
    
engfunc(EngFunc_SetModelusr_shield[id], vip_shield)

I do not know how to do that until the shield on his back, the damage got a shield.

Well the mud as a shield destroyed = (
Attached Files
File Type: zip cashield.zip (32.3 KB, 126 views)
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD is offline
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-17-2011 , 02:50   Re: Create shield entity to block damage?!
Reply With Quote #2

Maybe this can be done using RegisterHam (Ham_TakeDamage, ..?

But i dont know how do it!?(
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 01-17-2011 , 04:11   Re: Create shield entity to block damage?!
Reply With Quote #3

Something like that

PHP Code:

#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
}


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(
is_user_alive(victim) && cs_get_user_vip(victim))
        return 
HAM_SUPERCEDE
    
return HAM_IGNORED


Last edited by Flipper_SPb; 01-17-2011 at 04:14.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-17-2011 , 04:13   Re: Create shield entity to block damage?!
Reply With Quote #4

Thank you =)
Myself know such an option. Otherwise, do not like? Work with the loss for entity?
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD is offline
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-17-2011 , 04:15   Re: Create shield entity to block damage?!
Reply With Quote #5

I have not used it because I want to make a zone blocking - only where the shield.
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD 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 02:06.


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