Posts: 216
Threads: 60
Joined: Oct 2008
Reputation:
0
Is it just me, or does SetPlayerVelocity not work to well?
I'm trying to make it push me really high up. But no matter how large I make the Z value, the character just isn't getting much height from it. Anybody else noticed this?
Btw, I'm only going up about the height of 3 CJ's.
Posts: 117
Threads: 2
Joined: Nov 2009
Reputation:
0
You do know that it's only in effect when they're moving?
Posts: 1,896
Threads: 102
Joined: Oct 2008
Quote:
Originally Posted by waza75
It are Floats, Try this code for instance
Код:
if (!strcmp("/jump", cmdtext))
{
SetPlayerVelocity(playerid,0.0,0.0,10.0); //Forces the player to jump
return 1;
}
Hope it will work
PS: You had it something like 100000000, make it in the code 10000000.0
.0 is needed I think.
|
Putting it on 100000000 wont make it work at all it doesn't need to be that high, try 0.6.
SetPlayerVelocity also does not work if you are stood on the ground, you need to be airborne however you can if your in a car.
Heres what i use to do a 10ft jump up in a car
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
}
return 1;
}
Posts: 81
Threads: 18
Joined: Aug 2007
Reputation:
0
Nice, Learned something from this too. Thanks ^^
Posts: 1,896
Threads: 102
Joined: Oct 2008
Quote:
Originally Posted by Seif_
No, SetPlayerVelocity works regardless if you're moving or not.
|
This will not work unless your player is off the ground. Try it.
pawn Код:
if (!strcmp("/jump", cmdtext))
{
SetPlayerVelocity(playerid,0.0,0.0,0.2); //Forces the player to jump
return 1;
}