Raised This Month: $ Target: $400
 0% 

Respawn an entity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FakeNick
Senior Member
Join Date: Feb 2008
Location: Poland
Old 12-20-2008 , 06:46   Respawn an entity?
Reply With Quote #1

Hello.
I have a problem. When player touch an entity, it dissapear and i want to respawn a new entity on the origins of the old entity. I was thinking about set_task, but my code isn't working. Can someone help me? ;>
__________________


[||||||||||] Snowball war v3.05

Pol
ish translations here ;) (PM me if you want one).


FakeNick is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-20-2008 , 07:02   Re: Respawn an entity?
Reply With Quote #2

mm show code, dont understand why its dissapear
__________________
xPaw is offline
FakeNick
Senior Member
Join Date: Feb 2008
Location: Poland
Old 12-20-2008 , 07:06   Re: Respawn an entity?
Reply With Quote #3

No no, it must dissapear, because im deleting it, but how i can respawn a new entity on the origins of the old entity (just deleted one) ? Like in healthpacks :].
__________________


[||||||||||] Snowball war v3.05

Pol
ish translations here ;) (PM me if you want one).


FakeNick is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-20-2008 , 07:11   Re: Respawn an entity?
Reply With Quote #4

Don't delete it.
Set pev_solid -> SOLID_NOT
Set pev_effects -> pev_effects | EF_NODRAW
Set pev_nextthink -> get_gametime() + time_you_want_to_respawn


Then you also have to hook FM_THINK

in the Think function, check if the entity is one of those you use in your plugin, then, check if pev_effects & EF_NODRAW
In that case :
Set pev_solid to what it was set before when the entity should trigger the Touch
Set pev_effects -> pev_effects & ~EF_NODRAW
Set pev_nextthink if you need to.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
FakeNick
Senior Member
Join Date: Feb 2008
Location: Poland
Old 12-20-2008 , 07:15   Re: Respawn an entity?
Reply With Quote #5

I was thinking about FM_Think . Thanks connor, gonna test it.

@Edit

Hmm, when i set a ~EF_NODRAW like this :

PHP Code:
set_pev(ent,pev_effects & ~EF_NODRAW
there's a not needed light aura on entity. How i can delete it?
__________________


[||||||||||] Snowball war v3.05

Pol
ish translations here ;) (PM me if you want one).



Last edited by FakeNick; 12-20-2008 at 07:27.
FakeNick is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-20-2008 , 09:16   Re: Respawn an entity?
Reply With Quote #6

set_pev(ent,pev_effects, pev(ent,pev_effects) & ~EF_NODRAW)

But as you normally already no what is pev_effects value :

PHP Code:
new iEffects pev(ent,pev_effects)
if( 
iEffects EF_NODRAW )
{
    
set_pev(ent,pev_effectsiEffects & ~EF_NODRAW

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
FakeNick
Senior Member
Join Date: Feb 2008
Location: Poland
Old 12-20-2008 , 09:35   Re: Respawn an entity?
Reply With Quote #7

Thank you again connor, but i can't give You more karma.
__________________


[||||||||||] Snowball war v3.05

Pol
ish translations here ;) (PM me if you want one).


FakeNick is offline
Reply


Thread Tools
Display Modes

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 09:14.


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