Raised This Month: $ Target: $400
 0% 

Plese HELP!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
totalcsscripting
BANNED
Join Date: Jul 2010
Old 07-16-2010 , 17:55   Plese HELP!
Reply With Quote #1

i'm starting with scripting and i'm developing my firsts plugins.

I have this problem. I want to create a plugin wich gives me more health and armor.

but i noticed that the maximum of health is 250 and of armor is 900
if i run the cvar twice creates a totatally desaster.

i want to no how to pud like an if statement, saying that if health is 250, and yo add 100, only add 50 instead of 100.


thankss!!
totalcsscripting is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-16-2010 , 18:05   Re: Plese HELP!
Reply With Quote #2

There isn't a maximum health cap. The health number in your HUD will only show up to 255 (or 250, don't remember) and then reset once it passes that, but your actual health value will differ from what the HUD displays.

If you still wanted to do this, you'd do something similar to:
Code:
#define MAX_HEALTH  255 #define ADD_HEALTH  100 set_user_health( id, min( ( get_user_health( id ) + ADD_HEALTH ), MAX_HEALTH ) )
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 07:04.


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