Raised This Month: $ Target: $400
 0% 

Set Player Model 23/09/2022


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ZMatu
New Member
Join Date: Feb 2021
Location: Argentina
Plugin ID:
8191
Plugin Version:
1
Plugin Category:
All
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Place a custom model without having precache errors
    Old 09-23-2022 , 13:46   Re: Set Player Model 23/09/2022
    Reply With Quote #1

    [QUOTE=Grey83;2789495]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);

    [/QUOTE

    It just hadn't occurred to me to do it that way, I quite liked your solution, it simplifies it too much
    ZMatu is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-23-2022 , 14:50   Re: Set Player Model 23/09/2022
    Reply With Quote #2

    but how is this considered a plugin , maybe I'm wrong anyway, at least execute a cfg file for the model path
    __________________

    Last edited by alasfourom; 09-23-2022 at 14:52.
    alasfourom 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 07:13.


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