Raised This Month: $344 Target: $400
 86%   Almost there!

[Any] Set players health (with Spawn Health)


Post New Thread Reply   
 
Thread Tools Display Modes
MajorKitKat
Junior Member
Join Date: Aug 2018
Old 09-10-2018 , 03:32   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #31

Quote:
Originally Posted by joac1144 View Post
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 the 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 players 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:
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-

Not currently working on TF2, simply get unknown command error on both sm_hp and sm_spawnhp, is my server missing something?
MajorKitKat is offline
joac1144
Senior Member
Join Date: Dec 2012
Location: Copenhagen, Denmark
Old 09-11-2018 , 08:02   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #32

Quote:
Originally Posted by MajorKitKat View Post
Not currently working on TF2, simply get unknown command error on both sm_hp and sm_spawnhp, is my server missing something?
I haven't paid attention to Sourcemod or plugins for a long time, so I don't know if things have changed.
From the error itself, my best guess is that you might have installed it wrong.
Have you put the .smx file in your sourcemod/plugins folder?
__________________

Last edited by joac1144; 09-11-2018 at 08:06.
joac1144 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 09-11-2018 , 11:40   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #33

Here's a revised version.

Changes

1. Removed the dependency for cstrike.inc.
2. Moved some lines of code around.
Attached Files
File Type: sp Get Plugin or Get Source (sethealth.sp - 281 views - 3.3 KB)
__________________
Psyk0tik is offline
MajorKitKat
Junior Member
Join Date: Aug 2018
Old 09-11-2018 , 11:43   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #34

Quote:
Originally Posted by Crasher_3637 View Post
Here's a revised version.

Changes

1. Removed the dependency for cstrike.inc.
2. Moved some lines of code around.
Works like a gem, thanks a ton.

Last edited by MajorKitKat; 09-12-2018 at 02:55. Reason: I tested it. >_<
MajorKitKat is offline
MajorKitKat
Junior Member
Join Date: Aug 2018
Old 09-11-2018 , 11:44   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #35

Quote:
Originally Posted by joac1144 View Post
I haven't paid attention to Sourcemod or plugins for a long time, so I don't know if things have changed.
From the error itself, my best guess is that you might have installed it wrong.
Have you put the .smx file in your sourcemod/plugins folder?
Yes lol not my first plugin or server but thanks anyways looks like it's been updated so I'll be testing it later.
MajorKitKat is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 02-25-2021 , 07:48   Re: [Any] Set players health (with Spawn Health)
Reply With Quote #36

Quote:
Originally Posted by Crasher_3637 View Post
Here's a revised version.

Changes

1. Removed the dependency for cstrike.inc.
2. Moved some lines of code around.
After the authorized player uses the command to adjust the blood volume, the blood volume of the non-authorized player will also be adjusted, but not all players will be adjusted, and individual players who have no authorization will be adjusted.

Can anyone fix the plugin
__________________
I like this BBS sharing of spirit

I come from China, my English is poor
phoenix0001 is offline
Reply


Thread Tools
Display Modes

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 11:22.


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