AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Model (https://forums.alliedmods.net/showthread.php?t=317607)

Fuck For Fun 07-21-2019 06:54

Model
 
Why do not I see the MODEL that I also set up on CT?
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Player Models"
#define VERSION "1.0b"
#define AUTHOR "CheezPuff"

new const g_szModelsCT[ ] = "models/player/CTSkin/CTSkin.mdl"// Counte-Terrorists Model
new const g_szModelsT[ ] = "models/player/TSkin/TSkin.mdl"// Terrorists Model

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""fw_spawn"1);
}

public 
plugin_precache()
{
    
precache_modelg_szModelsCT );
    
precache_modelg_szModelsT );


public 
fw_spawnIndex )
{
    if( !
is_user_aliveIndex ) || is_user_botIndex ) )
        return;
    
    if( 
cs_get_user_teamIndex ) == CS_TEAM_CT )
    {
        
cs_set_user_modelIndex"g_szModelsCT" );
    }
    
    if( 
cs_get_user_teamIndex ) == CS_TEAM_T )
    {
        
cs_set_user_modelIndex"g_szModelsT" );
    }
    else 
cs_reset_user_modelIndex );



OciXCrom 07-21-2019 07:23

Re: Model
 
Because after you set it, you're checking (again) if the user is a terrorist, and if he's not (which he obviously isn't), you're reseting his model.

In simple words, this part of the code will ALWAYS run if the player is CT:

PHP Code:

else cs_reset_user_modelIndex ); 


Fuck For Fun 07-21-2019 07:33

Re: Model
 
Yes, that's what I noticed, and I removed it, and still not

tried this:
PHP Code:

public fw_spawnIndex )
{
    if( !
is_user_aliveIndex ) || is_user_botIndex ) )
        return;
   
    if (
cs_get_user_teamIndex ) == CS_TEAM_CTcs_set_user_modelIndex"g_szModelsCT")
   
    else if (
cs_get_user_teamIndex ) == CS_TEAM_Tcs_set_user_modelIndex"g_szModelsT")


Quote:

Error: could not load file models/player/g_szModelsT/g_szModelsT.mdl
EDIT: Fixed i dont know why should i set my folder mdl on this lines:
PHP Code:

public fw_spawnIndex )
{
    if( !
is_user_aliveIndex ) || is_user_botIndex ) )
        return;

    if( 
cs_get_user_teamIndex ) == CS_TEAM_CT )
    {
        
cs_set_user_modelIndex"CTSkin" );
    }

    else if( 
cs_get_user_teamIndex ) == CS_TEAM_T )
    {
        
cs_set_user_modelIndex"TSkin" );
    }



baby.exe 07-21-2019 07:42

Re: Model
 
Yoo,, try mine. it'll work! so easy tho.
https://www.mediafire.com/file/0hl7x.../baby.rar/file

OciXCrom 07-21-2019 08:04

Re: Model
 
Quote:

Originally Posted by baby.exe (Post 2659995)
Yoo,, try mine. it'll work! so easy tho.
https://www.mediafire.com/file/0hl7x.../baby.rar/file

Either post the .sma file or don't post at all.


All times are GMT -4. The time now is 17:31.

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