|
Senior Member
|
07-16-2018
, 22:50
Re: [CSGO] Thanos mode
|
#13
|
Quote:
Originally Posted by mug1wara
try this
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
static int g_iModel;
static const char g_sModel[] = "models/player/custom_player/kaesar2018/thanos/thanos.mdl";
methodmap Thanos
{
public static int Precache()
{
g_iModel = PrecacheModel(g_sModel);
if (g_iModel == 0)
{
ThrowError("Precache Failed!");
}
}
};
public void OnPluginStart()
{
RegAdminCmd("sm_thanos", Cmd_Thanos, ADMFLAG_GENERIC);
}
public void OnMapStart()
{
AddFileToDownloadsTable(g_sModel);
}
public Action Cmd_Thanos(int iClient, int iArgs)
{
Thanos.Precache();
PrintToChatAll("Thanos will appear in 30 secconds!");
SetEntityModel(iClient, g_sModel);
SetEntityHealth(iClient, 200);
SetEntProp(iClient, Prop_Data, "m_ArmorValue", 200, 1);
SetEntityModel(iClient, g_sModel);
SetEntPropFloat(iClient, Prop_Data, "m_flMaxspeed", 0.0);
CreateTimer(30.0, Timer_Unfreeze, iClient);
}
public Action Timer_Unfreeze(Handle hTimer, int iClient)
{
SetEntPropFloat(iClient, Prop_Data, "m_flMaxspeed", 1.0);
}
|
Use SetEntityMoveType to freeze + unfreeze the player. ( MOVETYPE_NONE to freeze; MOVETYPE_WALK to unfreeze)
Also, you don't need to precache the model everytime the command gets called, rather precache it once OnMapStart
Why are you using methodmaps for this? -.^
__________________
|
|
|
|