Here is the code i recived from teh DODSPlugin community but we have modified...
The problem we are running into right now is when the players health gets down to 0 it just burys them in the ground and they will not die...
please help see code below. we tryed the command
FakeClientCommand(client, "kill")
currently it is
ForcePlayerSuicide(client)
as both of these commands are causeing me to jsut bury into the ground may i please have some help ALL MIGHTY GURUS OF WISDOM!!!
Code:
//
// SourceMod Script
//
// Developed by Misery
// DECEMBER 2008
// http://thelw.forum-actif.net
//
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "2.0"
public Plugin:myinfo =
{
name = "Rambo Damage Mod",
author = "Misery",
description = "Dammage For Ramboing with MG",
version = "2.0",
url = "http://thelw.forum-actif.net"
};
new Handle:Cvar_rules_mg_Enable
new Handle:d_InfoMod[MAXPLAYERS + 1]
public OnPluginStart()
{
CreateConVar("sm_Rambo_dammage", PLUGIN_VERSION, "Dammage For Ramboing with MG", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY)
Cvar_rules_mg_Enable = CreateConVar("sm_rambo_dammage_enable", "1", "Enable/disable Dammage For Ramboing with MG", FCVAR_PLUGIN)
HookEvent("dod_stats_weapon_attack", PlayerAttackEvent)
PrintToServer("----------------| Sm_Rambo_Dammage Loaded |---------------")
}
public OnEventShutdown()
{
UnhookEvent("dod_stats_weapon_attack", PlayerAttackEvent)
}
public OnClientPutInServer (client)
{
if ((client == 0) || !IsClientConnected (client))
{
return
}
d_InfoMod[client] = CreateTimer (20.0, InfoMod, client, TIMER_FLAG_NO_MAPCHANGE)
}
public PlayerAttackEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "attacker"))
if (client == 0 || !IsClientInGame(client) || !IsPlayerAlive(client) || IsFakeClient(client))
{
return
}
if (GetConVarInt(Cvar_rules_mg_Enable) == 1)
{
new weapon_pos = GetEventInt(event, "weapon")
switch (weapon_pos)
{
case 35,36:
{
new health[MAXPLAYERS + 1]
health[client] = GetClientHealth(client)
if (health[client] >= 5)
{
health[client] = health[client] - 5
SetEntityHealth(client, health[client])
PrintToChat(client, "\x01\x04[Action]\x01 The jerking of your MG has caused you to hurt your arms because you had not deployed it before firing!")
}
else
{
ForcePlayerSuicide(client)
}
}
}
}
}
public Action:InfoMod(Handle:timer, any:client)
{
d_InfoMod[client] = INVALID_HANDLE
if ((GetConVarInt(Cvar_rules_mg_Enable) == 1) && IsClientConnected (client) && IsClientInGame (client) && !IsFakeClient(client))
{
PrintToChat (client, "\x01\x04[RULE]\x01 Ramboing with a MG will result in a loss of life!")
PrintToChat (client, "\x01\x04\x01 Developped by Misery !")
}
return Plugin_Handled
}