Jump to content

HP for medic


brk

Recommended Posts

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

Link to comment
Share on other sites

  • Management

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

 

http://mygamingtalk.com/wiki/index.php/Silent_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.com/wiki/index.php/Silent_Lua#et_ClientSpawn

Link to comment
Share on other sites

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
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...