Raised This Month: $ Target: $400
 0% 

get player armor & hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mandiii
Junior Member
Join Date: Jun 2010
Old 06-09-2010 , 18:58   get player armor & hp
Reply With Quote #1

For use like:

Code:
playerhp++
playerarmor++
Mandiii is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-09-2010 , 19:03   Re: get player armor & hp
Reply With Quote #2

What?
__________________
Hi.
Kreation is offline
Mandiii
Junior Member
Join Date: Jun 2010
Old 06-09-2010 , 19:19   Re: get player armor & hp
Reply With Quote #3

Im sorry, what should you write to return a players hp and armor?
Mandiii is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 06-09-2010 , 19:22   Re: get player armor & hp
Reply With Quote #4

HP:
http://www.amxmodx.org/funcwiki.php?...alth&go=search

Armor:
http://www.amxmodx.org/funcwiki.php?...rmor&go=search

Or

http://www.amxmodx.org/funcwiki.php?go=func&id=149

Not sure which one is better to use for the armor.
__________________
Hi.
Kreation is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-09-2010 , 22:21   Re: get player armor & hp
Reply With Quote #5

Quote:
Originally Posted by Kreation View Post
get_user_health
cs_get_user_armor

for cs_get_user_armor use #include <cstrike>
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Mandiii
Junior Member
Join Date: Jun 2010
Old 06-10-2010 , 10:27   Re: get player armor & hp
Reply With Quote #6

I get a warning from this code.

(213) "Tag mismatch" warning

PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION        "0.1"

public plugin_init()
{
    
register_plugin("armor"VERSION"Mandiii")
}

public 
client_death(killer)
{
    new 
CsArmorType:ArmorType 2
    
new Armor cs_get_user_armor(killerArmorType)
    
Armor += 20

Mandiii is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-10-2010 , 11:40   Re: get player armor & hp
Reply With Quote #7

Quote:
Originally Posted by Mandiii View Post
I get a warning from this code.

(213) "Tag mismatch" warning

PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION        "0.1"

public plugin_init()
{
    
register_plugin("armor"VERSION"Mandiii")
}

public 
client_death(killer)
{
    new 
CsArmorType:ArmorType 2
    
new Armor cs_get_user_armor(killerArmorType)
    
Armor += 20

Why are you trying to set a players armor when they are dead?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 06-10-2010 at 11:43.
GXLZPGX is offline
Mandiii
Junior Member
Join Date: Jun 2010
Old 06-10-2010 , 11:51   Re: get player armor & hp
Reply With Quote #8

Oh shit, forgot that. :p

Edit: still doesnt solve my problem though.

Last edited by Mandiii; 06-10-2010 at 12:16.
Mandiii is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-10-2010 , 14:25   Re: get player armor & hp
Reply With Quote #9

Try this:
PHP Code:
#include <amxmodx>
#include <cstrike>

#define VERSION        "0.1"

public plugin_init()
{
    
register_plugin("armor"VERSION"Mandiii")
}

public 
client_death(victim)
{
    new 
killer get_user_attacker(victim)
    
    new 
CsArmorType:ArmorType
    
new Armor cs_get_user_armor(killerArmorType)
    
cs_set_user_armor(killer,(Armor 20),ArmorType)

I changed 3 things. 1: I defined a killer by getting the attacker of the victim. 2: I removed the "= 2" after you created the ArmorType. 3: I made it so that it added the armor to the killer instead of just adding 20 to "Armor".

Last edited by RedRobster; 06-10-2010 at 14:29.
RedRobster 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 01:51.


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