AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved]Removing all spawned Entitys[can be closed] (https://forums.alliedmods.net/showthread.php?t=25940)

Stephen 03-24-2006 06:55

[Solved]Removing all spawned Entitys[can be closed]
 
Hi.
Ok a new Question again.

I created several Entitys and i made an command to remove them, BUT always the last created entity gets removed the other ones cannot be removed.

How can it be done that i can removed them all entity by entity or all at once ?

Code:
public remove(id) {     if ( avatar[id] !=0 )     {     remove_entity(avatar[id]);     avatar[id] = 0     }     return PLUGIN_HANDLED }

That im using to remove the entity

jtp10181 03-24-2006 06:59

when you make the entities give them a specific classname that you can find later.

ex:
Code:

entity_set_string(NewEnt, EV_SZ_classname, "lud_missile")
The do something like this. to get rid of them



Code:

        new iCurrent
        while ((iCurrent = find_ent_by_class(-1, "lud_missile")) != 0){
                remove_entity(iCurrent)
        }


Stephen 03-24-2006 07:11

heh Thx it works fantastico ^^.

I have an other question now^^

HOW can i make it so that the Entity that i spawned look in the direction where i looked at when spawning it ?
cause every Model i spawn look into 1 direction no matter where i look at.

akysiev 03-24-2006 07:15

entity_set_vector( ent, EV_VEC_angles, angles );

Stephen 03-24-2006 07:28

Hmm can you show me an working snippet of that ?

v3x 03-24-2006 07:29

http://www.amxmodx.org/funcwiki.php?go=func&id=333

Check the bottom, it may help you.

Stephen 03-24-2006 07:42

hmm i got it now to lock at other directions but HOW can i make it so it looks at the dircetion i am looking ?

each spawned entitymodel should look at different durections when i spawn them.
Code:
new Float:Vector[3];     entity_get_vector( avatar[id], EV_VEC_v_angle, Float:Vector )     Vector[0]=Float:255     Vector[1]=Float:100     Vector[2]=Float:0

this is what i have now.

VEN 03-24-2006 09:10

Quote:

HOW can i make it so it looks at the dircetion i am looking ?
Get your angles and set it to your entity.


All times are GMT -4. The time now is 16:35.

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