Need to find CURRENT hp
Title pretty much sums it up..
I need to know what would give me the info of someones CURRENT HP. So i could plug that into an equasion. |
Re: Need to find CURRENT hp
new health=get_user_health(id)
Requires to include fun.inc: #include <fun> Next Time try searching in the amxmodx.org FuncWiki first: http://www.amxmodx.org/funcwiki.php |
Re: Need to find CURRENT hp
*cough*
Isnt that wrong? shouldnt it be Code:
You just need to include the file "Amxmodx" Btw, the HP data is saved to the variable g_hp. And silencer is right, look in the FuncWiki before asking. (I hate it, but whatever :) ) |
Re: Need to find CURRENT hp
Quote:
Code:
/* Returns player health. */ |
Re: Need to find CURRENT hp
No, its just that you cant do:
Code:
You must do: Code:
|
Re: Need to find CURRENT hp
incorrect, infact it is sometimes better to initialize a variable at a specific value otherwise the variable when created can be any number of things
Code:
|
Re: Need to find CURRENT hp
u can
Code:
and there is no need to include fun |
Re: Need to find CURRENT hp
Hmm...i saw in the old AmxX doc that you have to do it the way i did.
Oh well. |
Re: Need to find CURRENT hp
both can be used:
Code:
Code:
But"new g_hp = get_user_health(id)" is better. Here the explain why. The "new" command reserve memory to store the value.If you use "new g_hp" the variable "g_hp" can hold a number that was stored in the memory from another (old) variable.This is a high risk when you use something like this Code:
Always initalize a variable with a value before you use them. |
Re: Need to find CURRENT hp
Incorrect. Pawn automaticly zeroes variables, unlike the C family.
|
| All times are GMT -4. The time now is 04:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.