AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem spawning weapons. (Solved) (https://forums.alliedmods.net/showthread.php?t=40908)

mysticssjgoku4 07-05-2006 21:38

Problem spawning weapons. (Solved)
 
Hmm.
I'm trying to make a plugin for my father that spawns weapons from a cfg file where he places them.
For some reason, it pulls the correct info such as "weapon_shotgun" for valve mod, with no errors and I guess it makes the entity, but, why doesn't it show in game?

I'm guessing you can't spawn entities like models?

Code:
public ent_spawn(SZ_ent_name[],x,y,z,angle) {     server_print("Name: %s | X: %i | Y: %i | Z: %i | Angle: %i",SZ_ent_name,x,y,z,angle)     new Float:originF[3]     new Float:angles[3] = { 0.0, 0.0, 0.0 }         new ent = create_entity(SZ_ent_name)         //Configure Origin     originF[0] = float(x)     originF[1] = float(y)     originF[2] = float(z)         //Configure Angle     angles[1] = float(angle)         //Set Origin     entity_set_origin(ent,originF)         //Set Angle     entity_set_vector(ent,EV_VEC_angles,angles)         //Set Class Name     entity_set_string(ent,EV_SZ_classname,SZ_ent_name)         g_num_ok++     return PLUGIN_HANDLED }

Zenith77 07-05-2006 21:39

Re: Problem spawning weapons.
 
DispatchSpawn(ent)

mysticssjgoku4 07-05-2006 22:15

Re: Problem spawning weapons.
 
I discourage the use of ripent. Thank you Zenith, you were much help.


All times are GMT -4. The time now is 08:02.

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