AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   spawning ents properly (https://forums.alliedmods.net/showthread.php?t=141215)

l4ulwtlln 10-20-2010 22:53

spawning ents properly
 
i was just wondering how you go about spawning ents into the world properly

something like this or do i need more?

Code:
    new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))     if (!pev_valid(ent)) return 0     set_pev(ent, pev_classname, "bananas")     set_pev(ent, pev_origin, origin)     engfunc(EngFunc_SetModel, ent, "models/banana.mdl")

Lulu the hero 10-21-2010 00:08

Re: spawning ents properly
 
Your version works, but you should add the DispatchSpawn(ent); line too under it.


All times are GMT -4. The time now is 10:18.

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