AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set mdl by saved value (https://forums.alliedmods.net/showthread.php?t=192456)

GarbageBox 08-10-2012 12:00

Set mdl by saved value
 
The original plugin only have one mdl and now I added few more, but I don't know how to set the mdl to player.
I want to set mdl depends on szSetHatID, just some numbers, 1 to 3.
PHP Code:

new MODEL_MARK[ ][ ]     ={
    
"models/test/1.mdl",
    
"models/test/2.mdl",
    
"models/test/3.mdl"
}

public 
plugin_precache( )
{
    for( new 
0sizeof MODEL_MARKi++ )
        
precache_modelMODEL_MARK] );
}

public 
client_PreThinkid )
{
    new 
szAuthID32 ];
    
get_user_authididszAuthIDsizeof szAuthID );
    
    
formatexszKeysizeof szKey 1"%s"szAuthID );
    
    if( 
nvault_getg_nVaultszKeyszGetHatIDsizeof szGetHatID ) )
    {
        
formatexszSetHatIDsizeof szSetHatID 1"%s"szGetHatID );
        
        
//client_print_color( id, DontChange, "^1%s ^4#%s already set for you^1.", PREFIX, szSetHatID ); 

        //...
        
if(g_adminmarkEnt[id] < 1)
        {
            
g_adminmarkEnt[id] = create_entity("info_target")
            if(
g_adminmarkEnt[id] > 0)
            {
                
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
                
entity_set_edict(g_adminmarkEnt[id], EV_ENT_aimentid)
                
entity_set_model(g_adminmarkEnt[id],MODEL_MARK)   //<--Here            
            
}
        }
        
//...




All times are GMT -4. The time now is 05:48.

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