Raised This Month: $32 Target: $400
 8% 

[csgo] player model problem !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sky162csgo
Junior Member
Join Date: Dec 2017
Old 12-15-2017 , 18:29   [csgo] player model problem !
Reply With Quote #1

Hello.I need simple plugin to change model for every player model.This plugin does't work ... Server will crash or plugin didn't add model for players.Anybody have you better ideas how can i give model for players ?


PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

public Plugin:myinfo 
{
    
name "PLAYERMODEL",
    
author "Unknown",
    
description "<- Description ->",
    
version "1.0",
    
url "<- URL ->"
}

public 
void OnPluginStart()
{
    
    
HookEvent("player_spawn",    EventPlayerSpawn);
}

public 
EventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast) {


        new 
client GetClientOfUserId(GetEventInt(event"userid"));
        new 
team GetClientTeam(client);

        if (!
IsFakeClient(client)) 
        {
                        if ((
team == 1))
                            
SetEntityModel(client"HERE T MODEL");
                        else if ((
team == 2))
                            
SetEntityModel(client"HERE CT MODEL");
                
        
        }

sky162csgo is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-15-2017 , 18:51   Re: [csgo] player model problem !
Reply With Quote #2

you need to precache your model before you can set it
__________________
8guawong is offline
sky162csgo
Junior Member
Join Date: Dec 2017
Old 12-16-2017 , 02:51   Re: [csgo] player model problem !
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
you need to precache your model before you can set it
I use sm downloader 1.4
sky162csgo is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-16-2017 , 03:52   Re: [csgo] player model problem !
Reply With Quote #4

Quote:
Originally Posted by sky162csgo View Post
I use sm downloader 1.4
and? you have to show us how you setup the sm_downloader so we know if you are using its precache function

and ins't the latest version 1.8 or something?
__________________

Last edited by 8guawong; 12-16-2017 at 03:52.
8guawong is offline
sky162csgo
Junior Member
Join Date: Dec 2017
Old 12-16-2017 , 04:26   Re: [csgo] player model problem !
Reply With Quote #5

Quote:
Originally Posted by 8guawong View Post
and? you have to show us how you setup the sm_downloader so we know if you are using its precache function

and ins't the latest version 1.8 or something?

OK ! It is working but i have problem with arms.



PHP Code:
#include <sourcemod> 
#include <sdktools> 
#include <cstrike> 

public Plugin:myinfo 
{
    
name "PLAYERMODEL",
    
author "Unknown",
    
description "<- Description ->",
    
version "1.0",
    
url "<- URL ->"
}


public 
OnMapStart()
{

        
AddFileToDownloadsTable("models/player/custom_player/kodua/snowman/snowman2.mdl");
        
AddFileToDownloadsTable("models/player/custom_player/kodua/snowman/snowman2.phy");
        
AddFileToDownloadsTable("models/player/custom_player/kodua/snowman/snowman2.vvd");
        
AddFileToDownloadsTable("models/player/custom_player/kodua/snowman/snowman2.dx90.vtx");

        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/carrot.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/hat_path2.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/hat2.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/ice.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/ice_arms.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/snowman2.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/stones.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/wood_arms.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/wood2.vmt");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/s.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/snowman_d.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/snowman_n.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/snowman/snowman_n2.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/shared/detail_cloth4.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/shared/detail_grit.vtf");
        
AddFileToDownloadsTable("materials/models/player/custom_player/kodua/shared/detail_snow.vtf");


        
PrecacheModel("models/player/custom_player/kodua/snowman/snowman2.mdl");




}


public 
void OnPluginStart()
{
    
    
HookEvent("player_spawn",    EventPlayerSpawn);
}

public 
EventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast) {


        new 
client GetClientOfUserId(GetEventInt(event"userid")); 
        new 
team GetClientTeam(client); 

        if (!
IsFakeClient(client))  
        { 
                        if ((
team == 2)) 
                            
SetEntityModel(client"models/player/custom_player/kodua/snowman/snowman2.mdl"); 
                        else if ((
team == 3)) 
                            
SetEntityModel(client"models/player/custom_player/kodua/snowman/snowman2.mdl"); 
                 
         
        } 



Last edited by sky162csgo; 12-16-2017 at 04:27.
sky162csgo is offline
Reply


Thread Tools
Display Modes

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 10:46.


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