Raised This Month: $51 Target: $400
 12% 

degree HP if...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-24-2009 , 16:51   degree HP if...
Reply With Quote #1

can somone make this work?

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

new gPlayerHP = (set_user_health(id))
new 
gFOK = (get_user_frags(id) - get_user_kills(id))

public 
plugin_init() {
    
register_plugin("test""1.0""Beancake12")
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
}

public 
player_spawn(id) {
   if(
gFOK => 0)
      
gPlayerHP 310 - (gFOK*10)


Last edited by timian; 06-26-2009 at 12:35.
timian is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-24-2009 , 17:07   Re: degree HP if...
Reply With Quote #2

I think it will compile and go in errors if the deaths is -
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-24-2009 , 17:54   Re: degree HP if...
Reply With Quote #3

it can't compile... but can you or somone else fix it for me?
timian is offline
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-26-2009 , 08:27   Re: degree HP if...
Reply With Quote #4

nobody can help me?
timian is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 06-26-2009 , 08:36   Re: degree HP if...
Reply With Quote #5

What are you really trying to do here?
Decreasing HP when.. what?
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Sid89
Junior Member
Join Date: Feb 2009
Old 06-26-2009 , 08:39   Re: degree HP if...
Reply With Quote #6

em... when you need to set user HP? when it spawns?
__________________
War... it never end's...
Sid89 is offline
timian
Member
Join Date: Oct 2006
Location: Denmark
Old 06-26-2009 , 09:58   Re: degree HP if...
Reply With Quote #7

Quote:
Originally Posted by Xellath View Post
What are you really trying to do here?
Decreasing HP when.. what?
e.g. if you kill 22 and you are dead 4 times then the result is 22-4 = 18
then i want to decree the players HP with 18*10 = 180 hp

did you understand me?

Quote:
Originally Posted by Sid89 View Post
em... when you need to set user HP? when it spawns?
look at it now, try to fix, but still i can't compile

Last edited by timian; 06-26-2009 at 10:06.
timian is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-26-2009 , 22:54   Re: degree HP if...
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
 
#define DEFAULT_HP 310
#define get_user_kd(%1) (get_user_frags(%1) - get_user_deaths(%1))
 
public plugin_init()
{
    
register_plugin("test""1.0""Beancake12")
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
}
 
public 
player_spawn(id)
{
   if(
get_user_kd(id) => 0)
      
set_user_health(idDEFAULT_HP - ( get_user_kd(id) * 10 ) )

You can't use variables as marcos, defines can do that.
Also, I don't really understand what you want to calculate with get_user_frags() - get_user_kills?(id), so I replaced it with deaths and returns the kd difference
__________________

Last edited by Hunter-Digital; 06-26-2009 at 22:57.
Hunter-Digital is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-26-2009 , 23:04   Re: degree HP if...
Reply With Quote #9

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

public plugin_init() {
    
register_plugin("test""1.0""Beancake12")
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
}

public 
player_spawn(id) {
   new 
score get_user_frags(id) - get_user_deaths(id);
   if(
score >= 0)
      
set_user_health(id310 - (score*10))

This plugin seems odd.
The better your range from frags to deaths is, the less extra health you receive?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 06-27-2009 , 09:29   Re: degree HP if...
Reply With Quote #10

hmmm maybe it is not
and also something new

i think this is good for training . or even for some1 who cannot win the 1st place he can now can .
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- 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 02:41.


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