Thread: [Solved] model problem
View Single Post
Author Message
generals
Senior Member
Join Date: Aug 2018
Old 09-09-2019 , 08:11   model problem
Reply With Quote #1

hi guys

i want to add model to end human

whats the problem?

i waiting for your help.. tnx

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

new Handle:hModel INVALID_HANDLE;

new 
String:model[256];

public 
OnPluginStart()
{
    
hModel CreateConVar("lh_model""models/player/bunny/bunny_funny.mdl");

    
HookEvent("round_end"Event_OnRoundEnd);
}

public 
OnMapStart()
{
    
GetConVarString(hModelmodelsizeof(model));
    
AddFileToDownloadsTable(model);
    
PrecacheModel(model);
}

public 
Event_OnRoundEnd(Handle:event, const String:name[], bool:silent)
{
    new 
CountPlayer 0Client 0;

    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
CountPlayer++;
            
Client i;
        }
    }

    if (
CountPlayer == && Client 0)
    {
        
SetEntityModel(Clientmodel);
    }


Last edited by generals; 09-23-2019 at 06:15.
generals is offline