Respawn an entity?
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? ;> |
Re: Respawn an entity?
mm show code, dont understand why its dissapear
|
Re: Respawn an entity?
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 :].
|
Re: Respawn an entity?
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. |
Re: Respawn an entity?
I was thinking about FM_Think :). Thanks connor, gonna test it.
@Edit Hmm, when i set a ~EF_NODRAW like this : PHP Code:
|
Re: Respawn an entity?
set_pev(ent,pev_effects, pev(ent,pev_effects) & ~EF_NODRAW)
But as you normally already no what is pev_effects value : PHP Code:
|
Re: Respawn an entity?
Thank you again connor, but i can't give You more karma.
|
| All times are GMT -4. The time now is 09:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.