[Fixed]Velocity Question
#1

i have SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.3); in my script so it sends your car to do a little jump but it stops completely at X and Y what are the values that leave X and Y uneffected so it doesnt stop?
Reply
#2

new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
Reply
#3

yea it jumps but it only goes up, so if your driving forward its like an instant brake but you go up.
Reply
#4

Quote:
Originally Posted by Seif_ [adream-rp.com
]
I don't understand. Your car jumps once and lands, right? That's what your script is suppose to do.
Quote:
Originally Posted by Jasen
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
No that's wrong. The floats are speeds, not position coordinates.
it maybe wrong but it works.
Reply
#5

no it doesnt work seif's right
Reply
#6

Quote:
Originally Posted by Jasen
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
pawn Код:
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,0 ,0 ,z+0.3);
Modified. Try that.
Reply
#7

Quote:
Originally Posted by V№ceC№ty
no it doesnt work seif's right
works for me
Reply
#8

Quote:
Originally Posted by ilikepie2221
Quote:
Originally Posted by Jasen
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
pawn Код:
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,0 ,0 ,z+0.3);
Modified. Try that.
that wont work its setting the speed to 0
Reply
#9

Код:
: error 003: declaration of a local variable must appear in a compound block
: warning 221: label name "Float" shadows tag name
: error 017: undefined symbol "x"
: warning 215: expression has no effect
: error 017: undefined symbol "x"
: error 017: undefined symbol "x"
: warning 203: symbol is never used: "Float"
its not right.
Reply
#10

Quote:
Originally Posted by Seif_ [adream-rp.com
]
Quote:
Originally Posted by ilikepie2221
Quote:
Originally Posted by Jasen
new Float, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
pawn Код:
GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
SetVehicleVelocity(GetPlayerVehicleID(playerid) ,0 ,0 ,z+0.3);
Modified. Try that.
It's not better... Like I said, they're SPEED floats, not coordinates. Don't put the player's coordinates there.

ViceCity, your code is making the car jump, meaning it jumps up and lands back again. That's exactly what it's suppose to do. So what's your problem?
He wants to to go forward while jumping, at the moment it will just stop as soon as he jumps

i have

Код:
			if (keys & KEY_SUBMISSION)
			{
				if(admin[playerid] == 1 || admin[playerid] == 2)
				{
					if (sjump[playerid] == 1)
					{
						if (IsPlayerInAnyVehicle(playerid))
						{
							new Float:x, Float:y, Float:z;
							GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
							SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.1);
						}
					}
				}
			}
and it works fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)