Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

HP

- - - - -

  • Please log in to reply
5 replies to this topic

#1
OFFLINE   Kaco123

Kaco123

    Newbie

  • Members
  • Pip
  • 4 posts
0
Unknown

Hello,
So I want to set hp for eng,cvops,field,soldier and medics.
When new player join on the server he has 100 HP but when he get 3 or 4 medics lvl his HP is 115. I want to set 140 HP from begining to the end biggrin.gif I have some script like this but it's not working properly.
 

 
function et_InitGame(levelTime, randomSeed, restart)
    et.RegisterModName("NQ health")
end

function et_ClientSpawn(clientNum, revived)

    et.gentity_set(clientNum, "health", 140)
    
end

 

After one death HP is 100 or 115 it depends from med lvl. When you are playing eng, or field it doesnt matter just not a med health points decline from 140 to 100 or 115. Can you help me guys with that?



#2
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
Are you using this for NQ or silent. (Sorry if obvious question seeing how you have "NQ health", just not sure if you are using that as reference or you are actually on NQ)

Cause there are two ways to do this and its easier in silent mod.

EDIT#2: If you are on silent I am pretty sure all you need to do is:
 
local MAX_HEALTH = 140 -- Change your max health here.

function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
    et.gentity_set( clientNum , "ps.stats" , 4 , MAX_HEALTH )
end
This will make all classes start with 140. But it isn't this easy on older mods.

EDIT#3: Actually this code MIGHT work for other mods. Maybe it was just legacy mod that it crashed my server.
^^

Edited by Zelly, 22 June 2015 - 12:02 AM.


#3
OFFLINE   Kaco123

Kaco123

    Newbie

  • Members
  • Pip
  • 4 posts
0
Unknown

I have nq, so it will work on my server?



#4
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better
I am not sure, you can try. Otherwise you might have to do it the more complex way.

Just test it while no one is on.

#5
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Are you using this for NQ or silent. (Sorry if obvious question seeing how you have "NQ health", just not sure if you are using that as reference or you are actually on NQ)

Cause there are two ways to do this and its easier in silent mod.

EDIT#2: If you are on silent I am pretty sure all you need to do is:
 

local MAX_HEALTH = 140 -- Change your max health here.

function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
    et.gentity_set( clientNum , "ps.stats" , 4 , MAX_HEALTH )
end
This will make all classes start with 140. But it isn't this easy on older mods.

EDIT#3: Actually this code MIGHT work for other mods. Maybe it was just legacy mod that it crashed my server.
^^

 

where the hell did i get health from? wtf.



#6
OFFLINE   Kaco123

Kaco123

    Newbie

  • Members
  • Pip
  • 4 posts
0
Unknown

it's working. Thank you very much






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users