Raised This Month: $51 Target: $400
 12% 

[REQ] plugin not working as it should


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[T4E]Demon
Junior Member
Join Date: Jul 2006
Old 08-12-2012 , 08:22   [REQ] plugin not working as it should
Reply With Quote #1

a friend of mine gave me the code for his plugin, wich was untestet, he helped me a bit trying to make it work as i wanted it to, but without any luck. i am trying to port kz maps from cs to tfc, without having to edit each and every map file. but the thing is, it converts all maps, not just the kz ones

PHP Code:
    #include <amxmodx>
    #include <engine>
    #include <fakemeta>

     
    
new bool:first
     
    
public plugin_precache() {
            
register_plugin(PLUGINVERSIONAUTHOR)
            new 
mapname[42]
            
get_mapname(mapname,41)
            if(!
find_ent_by_class(-1,"info_tfdetect")) {
                    
register_forward(FM_KeyValue"getkeyvalue")
            }
            else {
                    
pause("a")
            }
    }
    public 
getkeyvalue(entkvdid) {
            if (
pev_valid(ent)) {
                    new 
keyname[32]
                    
get_kvd(kvdidKV_KeyNamekeyname31)
                    if(
equali(keyname,"origin") && !first) {
                            new 
origin[20]
                            
get_kvd(kvdid,KV_Value,origin,19)
                           
                            new 
tfd =  create_entity("info_tfdetect")
                            
entity_set_string(tfdEV_SZ_classname"info_tfdetect")
                            
DispatchKeyValue(tfd,"origin",origin)
                            
DispatchKeyValue(tfd,"maxammo_shells","-1")
                            
DispatchKeyValue(tfd,"team1_name","Climbers")
                            
DispatchKeyValue(tfd,"number_of_teams","1")
                            
DispatchSpawn(tfd)
                            
first true
                    
}
                    new 
classname[32]
                    
get_kvd(kvdidKV_ClassNameclassname31)
                    if (
equali(classname"info_player_deathmatch") || equali(classname"info_player_start")) {
                            if(
equali(keyname,"origin")) {
                                    new 
origin[20]
                                    
get_keyvalue(ent,"origin",origin,19)
                                    
get_kvd(kvdid,KV_Value,origin,19)
                                    new 
spwn =  create_entity("info_player_teamspawn")
                                    
entity_set_string(spwnEV_SZ_classname"info_player_teamspawn")
                                    
DispatchKeyValue(spwn,"origin",origin)
                                    
DispatchKeyValue(spwn,"team_no","1")
                                    
DispatchSpawn(spwn)
                            }
                           
                    }
            }
            return 
FMRES_IGNORED
    

if anyone has any ideas about why it doesnt work, please answer my call, cause i have no knowledge in this kinda coding, i can edit maps manually and batch script, thats it.
__________________
If God Forgives ... THEN I DONT!

[T4E]Demon is offline
Send a message via MSN to [T4E]Demon Send a message via Skype™ to [T4E]Demon
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:03.


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