PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <cstrike>
new Handle:Cvar_Enable;
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "Predator",
author = "",
description = "Predator Mod",
version = PLUGIN_VERSION,
url = ""
};
public OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawnEvent);
Cvar_Enable = CreateConVar("mvp_enable", "1", "Enable/disable Predator Mod", FCVAR_PLUGIN);
PrintToServer("Predator Mod v1 - 2018")
}
public PlayerSpawnEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"))
if (GetClientTeam(client) == 2)
{
if (GetConVarInt(Cvar_Enable) == 1)
{
SetEntityModel(client,"models/player/custom/predator/predator.mdl");
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 255, 255, 255, 15);
SetEntityHealth(client, 600);
//EmitSoundToClient(client, "");
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2);
}
for(new i = 0; i < 4; i++)
{
new weapon = GetPlayerWeaponSlot(client, i);
if(weapon != -1)
{
}
}
}
else if (GetClientTeam(client) == 3)
{
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
//SetEntityModel(client,"models/player/.mdl Add Marine Here");
SetEntityRenderColor(client, 255, 255, 255, 255);
SetEntityHealth(client, 100);
}
}
This plugins keep crashing in game when joining the Terrorist team. Server is Linux based, of course I did use Linux version of SourceMod and MetaMod Source.
sv_disable_immunity_alpha "1" is also in server.cfg for it to work.
Any idea why it keep crashing? Can anybody help fix this up please?