AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dividing something in half (eg. health) (https://forums.alliedmods.net/showthread.php?t=29860)

Mini_Midget 06-14-2006 07:54

dividing something in half (eg. health)
 
how do you divide or half something
i want to make a plugin
if the user has half of the total hp, eg = amx_maxhp 500 || current hp is 178
and he just killed someone, i want to set his hp to the half to half of the cvar which is 250

an example of showing me how would be nice with comments in it

JohnJ3 06-14-2006 08:37

if you want to change hp of user use
Code:
new hp=get_user_health(id)
and
Code:
set_user_health(id,hp/2); // for example


All times are GMT -4. The time now is 07:56.

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