SA-MP Forums Archive
[Fixed]Velocity Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Fixed]Velocity Question (/showthread.php?tid=99244)



[Fixed]Velocity Question - V1ceC1ty - 26.09.2009

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?


Re: Velocity Question - Jasen - 26.09.2009

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


Re: Velocity Question - V1ceC1ty - 26.09.2009

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


Re: Velocity Question - Jasen - 26.09.2009

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.


Re: Velocity Question - V1ceC1ty - 26.09.2009

no it doesnt work seif's right


Re: Velocity Question - ilikepie2221 - 26.09.2009

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.


Re: Velocity Question - Jasen - 26.09.2009

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


Re: Velocity Question - Jasen - 26.09.2009

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


Re: Velocity Question - V1ceC1ty - 26.09.2009

Код:
: 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.


Re: Velocity Question - Jasen - 26.09.2009

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