AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Converting TSX Spawn Weapon to Metamod (https://forums.alliedmods.net/showthread.php?t=50494)

Minimum 01-27-2007 19:57

Converting TSX Spawn Weapon to Metamod
 
Alright, I am trying to convert TSX's ts_spawnweapon function to work with Metamod instead of Engine. I have ran into a problem though. When I execute this function nothing happens. No errors show up in the server console or anything. What could be the problem?

Code:
/*      Weapon Spawns */  stock ts_spawnweapon(weaponid[],duration[],extraclip[],spawnflags[],Float:Origin[3]) {     new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "ts_groundweapon"));     dllfunc(DLLFunc_Spawn, ent);     set_keyvalue(ent,"tsweaponid",weaponid);     set_keyvalue(ent,"wduration",duration);     set_keyvalue(ent,"wextraclip",extraclip);     set_keyvalue(ent,"spawnflags",spawnflags);     engfunc(EngFunc_SetOrigin, ent, Origin);     return PLUGIN_HANDLED; } /*      Set Keyvalue - Coded by Basic-Master */  stock set_keyvalue(ent, key[], value[]) {     new classname[32]     pev(ent, pev_classname, classname, 31)     set_kvd(0, KV_ClassName, classname)     set_kvd(0, KV_KeyName, key)     set_kvd(0, KV_Value, value)     set_kvd(0, KV_fHandled, 0)         dllfunc(DLLFunc_KeyValue, ent, 0) }


All times are GMT -4. The time now is 00:39.

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