AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   degree HP if... (https://forums.alliedmods.net/showthread.php?t=95552)

timian 06-24-2009 16:51

degree HP if...
 
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)



TitANious 06-24-2009 17:07

Re: degree HP if...
 
I think it will compile and go in errors if the deaths is -

timian 06-24-2009 17:54

Re: degree HP if...
 
it can't compile... but can you or somone else fix it for me?

timian 06-26-2009 08:27

Re: degree HP if...
 
nobody can help me?

Xellath 06-26-2009 08:36

Re: degree HP if...
 
What are you really trying to do here?
Decreasing HP when.. what?

Sid89 06-26-2009 08:39

Re: degree HP if...
 
em... when you need to set user HP? when it spawns?

timian 06-26-2009 09:58

Re: degree HP if...
 
Quote:

Originally Posted by Xellath (Post 857516)
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 (Post 857520)
em... when you need to set user HP? when it spawns?

look at it now, try to fix, but still i can't compile

Hunter-Digital 06-26-2009 22:54

Re: degree HP if...
 
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

Exolent[jNr] 06-26-2009 23:04

Re: degree HP if...
 
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?

--kml-- 06-27-2009 09:29

Re: degree HP if...
 
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 . :mrgreen:


All times are GMT -4. The time now is 15:34.

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