Raised This Month: $ Target: $400
 0% 

Why CT Model ReplacemenT??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 08-19-2009 , 12:48   Why CT Model ReplacemenT??
Reply With Quote #1

This code should replace all T's model to test999 Player Model. But it does replace all CT player Models too.. why??

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

#define VERSION "0.0.1"

new Trie:g_tModels

public plugin_init()
{
    
register_plugin("KadiR Models"VERSION"ConnorMcLeod")

    
register_forward(FM_SetClientKeyValue"SetClientKeyValue")

    
g_tModels TrieCreate()
    
TrieSetString(g_tModels"terror""test999")
    
TrieSetString(g_tModels"leet""test999")
    
TrieSetString(g_tModels"guerilla""test999")
    
TrieSetString(g_tModels"arctic""test999")
}

public 
plugin_end()
{
    
TrieDestroy(g_tModels)
}

public 
plugin_precache()
{
    
precache_model("models/player/test999/test999.mdl")
}

public 
SetClientKeyValue(idszInfoBuffer[], szKey[], szValue[])
{
    static const 
model[] = "model"
    
if( equal(szKeymodel) )
    {
        static 
szModel[12]
        
TrieGetString(g_tModelsszValueszModelcharsmax(szModel));
        
set_user_info(idmodelszModel)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

KadiR is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 08-19-2009 , 17:51   Re: Why CT Model ReplacemenT??
Reply With Quote #2

because you are not cheking teams !!!
you should check like this example

PHP Code:
#include <cstrike> 
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T)
{
    
than set the model

__________________
vato loco [GE-S] is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-19-2009 , 17:52   Re: Why CT Model ReplacemenT??
Reply With Quote #3

Conor made this?

WTF is rong with him? He made a misstake
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-19-2009 , 18:21   Re: Why CT Model ReplacemenT??
Reply With Quote #4

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

#define VERSION "0.0.1"

new Trie:g_tModels

public plugin_init()
{
    
register_plugin("KadiR Models"VERSION"ConnorMcLeod")

    
register_forward(FM_SetClientKeyValue"SetClientKeyValue")

    
g_tModels TrieCreate()
    
TrieSetString(g_tModels"terror""test999")
    
TrieSetString(g_tModels"leet""test999")
    
TrieSetString(g_tModels"guerilla""test999")
    
TrieSetString(g_tModels"arctic""test999")
}

public 
plugin_end()
{
    
TrieDestroy(g_tModels)
}

public 
plugin_precache()
{
    
precache_model("models/player/test999/test999.mdl")
}

public 
SetClientKeyValue(idszInfoBuffer[], szKey[], szValue[])
{
    static const 
model[] = "model"
    
if( equal(szKeymodel) )
    {
        static 
szModel[12]
        if( 
TrieGetString(g_tModelsszValueszModelcharsmax(szModel)) )
        {
            
set_user_info(idmodelszModel)
            return 
FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 15:13.


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