Raised This Month: $ Target: $400
 0% 

Creating an entity messes up


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 01-03-2007 , 22:48   Re: Creating an entity messes up
Reply With Quote #1

Code:
new tfdetect public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     new ent = find_ent_by_class(-1, "info_tfdetect");         if(ent)         remove_entity(ent);         tfdetect = create_entity("info_tfdetect");     if(tfdetect)     {         entity_set_string(tfdetect, EV_SZ_classname, "info_tfdetect");         DispatchKeyValue(tfdetect, "origin", "0 0 0");         DispatchKeyValue(tfdetect, "maxammo_shells", "1006");         DispatchKeyValue(tfdetect, "team1_name", "SuRf3rs!");         DispatchKeyValue(tfdetect, "hook_out", "0");         DispatchKeyValue(tfdetect, "ex_skill_max", "3");         DispatchKeyValue(tfdetect, "ex_skill_min", "1");         DispatchSpawn(tfdetect) // you was missing this vital part     } } /* You shouldn't really need any of this below public plugin_precache() {     register_forward(FM_KeyValue, "forward_keyvalue"); } public forward_keyvalue(ent2, kvdid) {     if(!pev_valid(ent2))         return FMRES_IGNORED;     // You should have a classname check here for "info_tfdetect"     // else you're messing with every single entity that calls this function!     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 // at the end of function }*/
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 01-04-2007 at 07:06.
Orangutanz 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 22:28.


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