Raised This Month: $ Target: $400
 0% 

How can use armor as health?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kation
Junior Member
Join Date: Jul 2009
Location: China,中
Old 07-31-2009 , 09:15   How can use armor as health?
Reply With Quote #1

I only can do this:
Code:
register_event("Damage", "event_damagechaneg", "be")
 
 
public event_damagechaneg(id) {
 new iDamage = read_data(2)
 new playerap = get_user_armor(id)
 new playerhp = get_user_health(id)
 if (playerap - iDamage >= 0 ) {
  cs_set_user_armor(id, playerap - iDamage ,CS_ARMOR_VESTHELM)
  set_user_health(id ,playerhp + iDamage)
 }
 else if ((playerap - iDamage < 0 ) && (playerap + playerhp - iDamage > 0)) {
  cs_set_user_armor(id,0,CS_ARMOR_VESTHELM)
  set_user_health(id ,playerhp + playerap - iDamage)
 }
But, if iDamage > playerhp , then whatever playerap he will dead...
Kation is offline
 


Thread Tools
Display Modes

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 18:20.


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