Posts: 2,286
Threads: 18
Joined: Jun 2010
Well, I'm trying to make the player jump on top of a building by using:
Код:
SetPlayerVelocity(playerid,0.0,-0.1,100);
but he only jumps like 3-4 ft high. Any ideas?
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by mineralo
https://sampwiki.blast.hk/wiki/SetPlayerVelocity
pawn Код:
if (!strcmp("/jump", cmdtext)) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z) SetPlayerVelocity(playerid,x,y,(z+5)); //Forces the player to jump return 1; }
that you wanted?
|
Not at all. This will boost me with the speed of light probably. You don't know how SetPlayerVelocity works, do you?
Edit: Tested it, and yep, it crashed my client.
Posts: 1,046
Threads: 29
Joined: Mar 2010
pawn Код:
//...
new Float:pVel[3]; //Our variable to store the current player velocity
GetPlayerVelocity(playerid, pVel[0], pVel[1], pVel[2]); //This function gets our velocity
SetPlayerVelocity(playerid, pVel[0], pVel[1], pVel[2]*5); //This function sets the players velocity. I've tried to set 5x velocity for Z.
//...
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by BigETI
pawn Код:
//... new Float:pVel[3]; //Our variable to store the current player velocity GetPlayerVelocity(playerid, pVel[0], pVel[1], pVel[2]); //This function gets our velocity SetPlayerVelocity(playerid, pVel[0], pVel[1], pVel[2]*5); //This function sets the players velocity. I've tried to set 5x velocity for Z. //...
|
No. Why would I even need my velocity to be saved into a variable? I want the player simply to go up like 100 ft high, no matter of their velocity.
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by mineralo
then try this
pawn Код:
if (!strcmp("/jump", cmdtext)) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z) SetPlayerPos(playerid,x,y,(z+5)); //Forces the player to jump return 1; }
|
Yea, and that takes out all the realism. I wouldn't create this thread if I wanted the player to simply teleport, would I ?
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by Lorenc_
Have you considered testing it?
|
Not at all since I want the player to actually move to the top of the building, not just teleport there, you know what I mean?