Jump to content
  • 0

pomoc Rýchlosť behania/šprintovania


elRobertino

Dotaz

Ahojte, potreboval by som od vás radu. Jedna sa o to, že potrebujem zvýšiť rýchlosť behania hráčovi. 

Niekde so čítal že sa to robí s velocity ale neviem ako. Tak, ak by niekdo vedel tak by som mu bol vďačný...

Link to comment
Share on other sites

5 odpovědí na tuto otázku

Recommended Posts

  • 0

Takhle bych to udělal já. Ovšem nevím, jestli to funguje.
 
Mělo by to fungovat, pokud bude hráč držet mezerník

#define HOLDING(%0) \
	((newkeys & (%0)) == (%0))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (HOLDING(KEY_SPRINT))
	{
		if (!IsPlayerInAnyVehicle(playerid))
		{
			new Float:runx,Float:runy,Float:runz;
GetPlayerVelocity(playerid,runx,runy,runz);
SetPlayerVelocity(playerid,runx*2,runy*2,runz*2);
		}
	}
	return 1;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...