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 for medic


  • Please log in to reply
4 replies to this topic

#1
OFFLINE   brk

brk

    Newbie

  • Members
  • Pip
  • 13 posts
3
A step in the right direction

I want to limit the amount of hp for a medic because I think that with the amount of hp is a rambo medic: (Complain to the players from my server, it's hard to kill him (before I nq server and make the game more fair.) Skryp I who limits the amount of hp for medic but also reduces the hp other classes. and I want everyone to have equal, how to do?

 

function et_InitGame(levelTime,randomSeed,restart)
    hp = 140
end

function et_ClientSpawn(playerID, revived)
    if revived == 1 or et.gentity_get(playerID, "sess.playerType") == 0 then return end
    local weapon = et.gentity_get(playerID, "s.weapon")
    et.gentity_set(playerID, "ps.stats", 0, hp)
    et.gentity_set(playerID, "ps.ammo", weapon, ammo)
end



#2
OFFLINE   JohnDory

JohnDory

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 248 posts
54
Getting Better
  • LocationCornwall, UK

a quick way to slow them down is to stop them picking up their own med packs and reset the xp every now and again.



#3
OFFLINE   brk

brk

    Newbie

  • Members
  • Pip
  • 13 posts
3
A step in the right direction

It will be easier to set dmg weapons



#4
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

Wiki has the possible fields you can read and sometimes write with player entities.

 

http://mygamingtalk....Lua#gentity_get

 

Not all of the fields can be written with gentity_set.

 

EDIT:

Notice that your G_ClientSpawn is missing parameters.

 

http://mygamingtalk....#et_ClientSpawn



#5
OFFLINE   brk

brk

    Newbie

  • Members
  • Pip
  • 13 posts
3
A step in the right direction

Formedic I managed to get 140 hp but for the other classes have not: (where I'm doing wrong?

 

function et_InitGame(levelTime,randomSeed,restart)
    hp = 140
end

function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
cno_class = et.gentity_get(playerID, "sess.playerType")
et.gentity_set(playerID, "ps.stats", 0, hp)
hp = et.gentity_get(playerID, "ps.stats", 0)

    
end
 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users