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(hModel, model, sizeof(model));
AddFileToDownloadsTable(model);
PrecacheModel(model);
}
public Event_OnRoundEnd(Handle:event, const String:name[], bool:silent)
{
new CountPlayer = 0, Client = 0;
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsPlayerAlive(i))
{
CountPlayer++;
Client = i;
}
}
if (CountPlayer == 1 && Client > 0)
{
SetEntityModel(Client, model);
}
}