Jump to content

Home

Player Speed


Astelraid

Recommended Posts

Posted

Check out bp_move.c and look at how rage and speed when activated affect the player speed. If you want to edit the overall speed just change with a cvar the /g_speed where 280 I think is the default.

Posted

yes yes i understand that but i cant figure out how should the code look like for when player has like 50 health then the player movement speed will be slower also. so could someone post a code for that? so i could get a start.

Posted
  Astelraid said:
is there a specific location in the file where i could write the code? for when player has like 50 health then the player movement speed will be slower also.

 

In the file I was telling you about, look for these lines, you can do a search for just the first line (ctf+f):

 

(ps->fd.forcePowersActive & (1 << FP_RAGE))

{

ps->speed *= 1.3;

}

 

Add an if statement above or below that like so:

 

if(ps->stats[sTAT_HEALTH] <= ps->stats[sTAT_MAX_HEALTH] * .5)

ps->speed *= .6;//or whatever else you would like

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...