Speed Boost is bugged
#1

Hey Guys,
i made a Speed boost, but if i press the Key ingame, nothing happens.
Can anyone correct it, please? =)

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  	if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
 	{
  		if (newkeys & KEY_SUBMISSION)
		{
			new Float:xx, Float:xy, Float:xz;
			GetVehicleVelocity(GetPlayerVehicleID(playerid),xx, xy, xz);
			SetVehicleVelocity(GetPlayerVehicleID(playerid),x*5,y*5,z*5);
			return 1;
		}
		return 1;
	}
	return 1;
}
Reply
#2

Try put the verification: if(new keys ... before at if ( IsPlayerInVe...
Reply
#3

Isn't working >.<
But thanks...
any other solutions ?
Reply
#4

A little error, the float variable is xx,yy,and xz, and you put x*5,y*5,z*5:
So:
pawn Код:
SetVehicleVelocity(GetPlayerVehicleID(playerid),xx*5,xy*5,xz*5);
Reply
#5

nope, still bugged xD
Reply
#6

Код:
if (PRESSED(KEY_JUMP))
	{
		new
			Float:x,
			Float:y,
			Float:z;
		GetPlayerPos(playerid, x, y, z);
		SetPlayerPos(playerid, x*5, y*5, z*5);
	}
	return 1;
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

source samp wiki
Reply
#7

Why do you have return 1; 3 times? delete the first 2.
Reply
#8

both of your solutions aren't working...
What the hell is wrong with that script? O.o
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)