View Single Post
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-23-2022 , 13:24   Re: Set Player Model 23/09/2022
Reply With Quote #2

why not in this way?
PHP Code:
#pragma semicolon 1

#include <sdktools_functions>

static const char MODEL[] = "models/_*.mdl"// path to used player model

bool bPrecached;

public 
OnMapStart()
{
    
bPrecached IsModelPrecached(MODEL) || PrecacheModel(MODELtrue);
}

public 
OnPluginStart()
{
    
HookEvent("player_spawn"Event_Spawn);
}

public 
void Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    if(!
bPrecached) return;

    
int client GetClientOfUserId(event.GetInt("userid"));
    if(
client && IsPlayerAlive(client)) SetEntityModel(clientMODEL);

__________________
Grey83 is offline