Raised This Month: $ Target: $400
 0% 

Creating an entity messes up


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 01-02-2007 , 19:23   Creating an entity messes up
Reply With Quote #1

Hey everyone, I have a plugin that is supposed to create an entity "info_tfdetect". This entity controls settings for the maps in the game Team Fortress Classic. With this plugin I am trying to remove a current "info_tfdetect" if there is one, then make a new one. After it is created it should set the values to it.

All the plugin seems to do at the moment is spawn every entity in the map at 0,0,0 origin.

Here is the code...
Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     new ent = find_ent_by_class(-1, "info_tfdetect");         if(ent)     {         remove_entity_name("info_tfdetect");     }         create_entity("info_tfdetect");     entity_set_string(ent, EV_SZ_classname, "info_tfdetect");     DispatchKeyValue(ent, "origin", "0 0 0");     DispatchKeyValue(ent, "maxammo_shells", "1006");     DispatchKeyValue(ent, "team1_name", "SuRf3rs!");     DispatchKeyValue(ent, "hook_out", "0");     DispatchKeyValue(ent, "ex_skill_max", "3");     DispatchKeyValue(ent, "ex_skill_min", "1"); } public plugin_precache() {     register_forward(FM_KeyValue, "forward_keyvalue") } public forward_keyvalue(ent, kvdid) {     if(ent)     {         new keyname[128];                 get_kvd(kvdid, KV_KeyName, keyname, 127);                 if(equal(keyname, "origin"))         {             set_kvd(kvdid, KV_Value, "0 0 0");         }         else if(equal(keyname, "maxammo_shells"))         {             set_kvd(kvdid, KV_Value, "1006");         }         else if(equal(keyname, "team1_name"))         {             set_kvd(kvdid, KV_Value, "SuRf3rs!");         }         else if(equal(keyname, "hook_out"))         {             set_kvd(kvdid, KV_Value, "0");         }         else if(equal(keyname, "ex_skill_max"))         {             set_kvd(kvdid, KV_Value, "3");         }         else if(equal(keyname, "ex_skill_min"))         {             set_kvd(kvdid, KV_Value, "1");         }     }         return FMRES_IGNORED }
hlstriker is offline
 



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 22:28.


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