Problem with SetPlayerVelocity -
Celson - 07.01.2010
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.
Re: Problem with SetPlayerVelocity -
[HiC]TheKiller - 07.01.2010
Code?
Re: Problem with SetPlayerVelocity -
Calon - 07.01.2010
You do know that it's only in effect when they're moving?
Re: Problem with SetPlayerVelocity -
Celson - 07.01.2010
Quote:
Originally Posted by [HiC
TheKiller ]
Code?
|
SetPlayerVelocity(playerid,0,0,10000000);
That will barley make the player jump high at all. I've used that in OnPlayerEnterCheckpoint.
Quote:
Originally Posted by Calon
You do know that it's only in effect when they're moving?
|
Ehh, never noticed that. Or maybe I just don't understand what you are trying to say.
Re: Problem with SetPlayerVelocity -
waza75 - 07.01.2010
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.
Re: Problem with SetPlayerVelocity -
waza75 - 07.01.2010
Also see
https://sampwiki.blast.hk/wiki/SetPlayerVelocity ^^
Re: Problem with SetPlayerVelocity -
V1ceC1ty - 07.01.2010
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;
}
Re: Problem with SetPlayerVelocity -
waza75 - 07.01.2010
Nice, Learned something from this too. Thanks ^^
Re: Problem with SetPlayerVelocity -
Calon - 07.01.2010
Quote:
Originally Posted by Seif_
No, SetPlayerVelocity works regardless if you're moving or not.
|
Are you sure? I thought it worked like SetVehicleVelocity.
Re: Problem with SetPlayerVelocity -
V1ceC1ty - 07.01.2010
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;
}