Raised This Month: $ Target: $400
 0% 

Slap for fraction of HP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 01-29-2014 , 11:22   Slap for fraction of HP
Reply With Quote #1

I'm wondering is it possible to slap for fraction of target player HP? I want to make a plugin with autoslap punishment, which would take away 1/3 or 1/2 of player's HP.

Code:
{
			decl String:sName[64];
			GetClientName(target, sName, sizeof(sName));
			ServerCommand("sm_slap %s 1/3");
__________________
Wilczek is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-29-2014 , 11:25   Re: Slap for fraction of HP
Reply With Quote #2

GetClientHealth and SlapPlayer
KissLick is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-29-2014 , 11:30   Re: Slap for fraction of HP
Reply With Quote #3

Bad, bad, bad. Don't use servercommand with names...

Code:
new hp = GetClientHealth(client)
hp = hp - (hp/3);
SlapPlayer(client, hp);
Mitchell is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 01-29-2014 , 21:11   Re: Slap for fraction of HP
Reply With Quote #4

You really shouldn't be using ServerCommand's for something like this; however, if you do use a ServerCommand to issue a command on a client, supply the client's userid.
Marcus_Brown001 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-29-2014 , 22:18   Re: Slap for fraction of HP
Reply With Quote #5

Quote:
Originally Posted by Marcus_Brown001 View Post
You really shouldn't be using ServerCommand's for something like this; however, if you do use a ServerCommand to issue a command on a client, supply the client's userid.
you just said what i said before.
Mitchell is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-29-2014 , 23:46   Re: Slap for fraction of HP
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
you just said what i said before.
You really shouldn't be using ServerCommand's for something like this; however, if you do use a ServerCommand to issue a command on a client, supply the client's userid.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 01-29-2014 at 23:46. Reason: >.<" >.<"
GsiX is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 01-30-2014 , 00:03   Re: Slap for fraction of HP
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
Bad, bad, bad. Don't use servercommand with names...

Code:
new hp = GetClientHealth(client)
hp = hp - (hp/3);
SlapPlayer(client, hp);
It works like a charm! Also, thanks for linking to this exploit, I wasn't aware of it.
__________________
Wilczek is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 01-30-2014 , 02:03   Re: Slap for fraction of HP
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
Bad, bad, bad. Don't use servercommand with names...

Code:
new hp = GetClientHealth(client)
hp = hp - (hp/3);
SlapPlayer(client, hp);
You just said what I said before :-D :-D
KissLick is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-30-2014 , 08:53   Re: Slap for fraction of HP
Reply With Quote #9

Quote:
Originally Posted by KissLick View Post
You just said what I said before :-D :-D
No no.. you just said what I did not said yet.
Code:
new hp = GetClientHealth(client)
hp = hp - (hp/3);
SlapPlayer(client, hp);
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 01-30-2014 at 08:54. Reason: >.<" >.<"
GsiX 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 00:58.


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