AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Set players health (with Spawn Health) (https://forums.alliedmods.net/showthread.php?t=233971)

joac1144 01-23-2014 04:44

[Any] Set players health (with Spawn Health)
 
1 Attachment(s)
Description
One of my friends needed a plugin to set players' health, but he only wanted the health command, not all the others from SM Super Commands.
So I wrote this plugin to him and decided to publish it here if anyone wants this too.


CVAR list:
No ConVars.


Command list:
sm_hp <name or #userid> <HP> - Sets a player's health
sm_spawnhp <name or #userid> <HP> - Sets an amount of health to a player on spawn.
Examples:
sm_hp player1 200
sm_hp @all 500
sm_spawnhp player1 200
sm_spawnhp @all 500

Admin Flag SLAY/F is required to use the commands.


Changelog:
Quote:

1-23-2014 (v1.0)

*Plugin released

2-1-2014 (v1.1)

*Now loads the common.phrases translations file

2-8-2014 (v1.2)

*You can't set health to 0 or below

5-6-2014(v1.3)

*Added sm_spawnhp to set players health on spawn

10-06-2015 (v1.3.5)

*Updated code

12-11-2017 (v2.0)

*Updated to new syntax
*Fixed the spawnhp command
Installation:
Download sethealth.smx and put it into addons/sourcemod/plugins folder.


Bugs:
CS:GO:
Setting the health to 0 stops the player from any movement or hud display.
TF2:
Setting the health to 0 or below will give the player god mode.
I have currently fixed this by making it impossible to use a value of 0 or below.


-This is my second plugin ever-

404UserNotFound 01-31-2014 18:02

Re: [Any?] Set players health
 
We already have a Set Health plugin.

That plugin supports a number of games, whereas this one is incredibly small in size and probably only works for one game.

It's good work for a second plugin though, I'll give ya that.

Bacardi 01-31-2014 18:10

Re: [Any?] Set players health
 
You haven't load translation which ReplyToTargetError and translated target name require...

joac1144 01-31-2014 19:10

Re: [Any?] Set players health
 
Quote:

Originally Posted by Bacardi (Post 2093517)
You haven't load translation which ReplyToTargetError and translated target name require...

Thank you, I forgot that.
Plugin updated.

joac1144 01-31-2014 19:12

Re: [Any?] Set players health
 
Quote:

Originally Posted by abrandnewday (Post 2093515)
We already have a Set Health plugin.

That plugin supports a number of games, whereas this one is incredibly small in size and probably only works for one game.

It's good work for a second plugin though, I'll give ya that.

I haven't tested this in other games than CS:S, but I think it should work in all Source 2009 games.

hannes96 01-31-2014 21:15

Re: [Any?] Set players health
 
Good Job! The plugin works fine for TF2. It's even better than the other one because I can set the hp lower than normal (for example I can't set the Heavys health under 300 with the other plugin). But if you set the hp to 0 or anything lower with this plugin you are invincible.

Maxximou5 01-31-2014 22:18

Re: [Any?] Set players health
 
Works for CS:GO using values of -999 - -1 > 0 < 1-999, using a value of 0 stops the player from any movement or hud display. A great small nifty plugin nonetheless.

404UserNotFound 02-01-2014 01:16

Re: [Any?] Set players health
 
Quote:

Originally Posted by hannes96 (Post 2093567)
But if you set the hp to 0 or anything lower with this plugin you are invincible.

Uh...that's what God Mode plugins are for :lol:

joac1144 02-01-2014 06:44

Re: [Any?] Set players health
 
Quote:

Originally Posted by hannes96 (Post 2093567)
Good Job! The plugin works fine for TF2. It's even better than the other one because I can set the hp lower than normal (for example I can't set the Heavys health under 300 with the other plugin). But if you set the hp to 0 or anything lower with this plugin you are invincible.

I just tested this in my CS:S server and when I give myself 0 HP, I can still die.
I don't think I can fix this in TF2 since I'm noob to Sourcemod scripting and doesn't have a TF2 server

joac1144 02-01-2014 15:40

Re: [Any?] Set players health
 
Quote:

Originally Posted by Maxximou5 (Post 2093585)
Works for CS:GO using values of -999 - -1 > 0 < 1-999, using a value of 0 stops the player from any movement or hud display. A great small nifty plugin nonetheless.

I can't seem to find a fix for this, but thanks for testing it.


All times are GMT -4. The time now is 21:00.

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