Raised This Month: $ Target: $400
 0% 

Need help with finding/replacing entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eradftw2678
New Member
Join Date: Aug 2009
Old 08-05-2009 , 22:40   Need help with finding/replacing entities
Reply With Quote #1

So i found this code because it is the script i need, but i dont know how to modify it. I know the names of the entities, and I need to make them target something because right now they target nothing, what do i change in this code to make it work?

Code:
public find_and_replace(model[],type)
{
    new maxplayers = get_maxplayers()
    new temp_entlist[30]
    new num = 0;
    new Float:origin[3]
    new ent = engfunc(EngFunc_FindEntityByString,maxplayers,"model",model)
    while(ent)
    {
        temp_entlist[num] = ent
        num++
        ent = engfunc(EngFunc_FindEntityByString,ent,"model",model)
    }
    for(new i=0;i<num;i++)
    {
        pev(temp_entlist[i],pev_origin,origin)
        ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"armoury_entity"))
        set_pev(ent,pev_classname,"armoury_entity")
        engfunc(EngFunc_SetModel,ent,model)
        cs_set_armoury_type(ent,type)
        set_pev(ent,pev_solid,SOLID_TRIGGER)
        set_pev(ent,pev_movetype,MOVETYPE_FLY)
        set_pev(ent,pev_flags,512)
        engfunc(EngFunc_SetOrigin,ent,origin)
        engfunc(EngFunc_RemoveEntity,temp_entlist[i])
        dllfunc(DLLFunc_Spawn,ent)
    }
}

Last edited by eradftw2678; 08-05-2009 at 22:50.
eradftw2678 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 18:30.


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