Raised This Month: $51 Target: $400
 12% 

not slapplayer command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
colwulf
Member
Join Date: Jun 2008
Old 12-10-2008 , 18:27   not slapplayer command
Reply With Quote #1

i need help i need to find a command that will dammage a player that is not SlapPlayer(client, Dammage, sound) Please help
colwulf is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-10-2008 , 23:24   Re: not slapplayer command
Reply With Quote #2

I answered your question on the DoDSPluginsCommunity
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
colwulf
Member
Join Date: Jun 2008
Old 12-11-2008 , 01:10   Re: not slapplayer command
Reply With Quote #3

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
}

Last edited by colwulf; 12-11-2008 at 08:30.
colwulf is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-11-2008 , 07:24   Re: not slapplayer command
Reply With Quote #4

1. Use [code] tags around code so we can read it.
2. ForcePlayerSuicide works fine whenever I use it. Are you testing this in spawn, or outside of spawn? In DoD:S you can't slay anyone in spawn.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
colwulf
Member
Join Date: Jun 2008
Old 12-11-2008 , 08:33   Re: not slapplayer command
Reply With Quote #5

it is being tested out side spawn...

The Bigest problem is when the users health reaches 0 they do not die just get basicly buried in the ground...

added the [code] brackets i will repost if you need me to with the ecact code inclusding spaces
colwulf is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-11-2008 , 08:49   Re: not slapplayer command
Reply With Quote #6

If their health reaches zero, it should be going to the ForcePlayerSuicide part
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
colwulf
Member
Join Date: Jun 2008
Old 12-11-2008 , 09:04   Re: not slapplayer command
Reply With Quote #7

so it need to look more like

Code:
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)
 {
  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!")
 }
  if (health[client] >= 0)
  {
  ForcePlayerSuicide(client)
  }
 }
 }
 
}
}
colwulf is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-11-2008 , 09:13   Re: not slapplayer command
Reply With Quote #8

...no

That would kill the player every time.

change
if (health[client] >= 5) to
if (health[client] > 5)
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
colwulf
Member
Join Date: Jun 2008
Old 12-11-2008 , 09:21   Re: not slapplayer command
Reply With Quote #9

ok i think i understand it would be
Code:
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)
}
}
}
And that should do it right?
colwulf is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 12-11-2008 , 12:23   Re: not slapplayer command
Reply With Quote #10

Yup.

Because before you would still take 5 hp away when they only HAD 5 hp. And when you take their health to 0, they get buried.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode