Car goes into the air on button push?
#1

A few stunt servers have the "+" button make you rise into the air with your car. (eg: Awesome Stuntages, .:Ultimate Stuntages:.)

I did search the forums but is stupid cause it says the words are too short, but if I make them longer, there are no results.

Does anyone know this code?
Reply
#2

pawn Код:
new Float:vx, Float:vy, Float:vz;
GetVehicleVelocity(playerid, vx, vy, vz);
SetVehicleVelocity(playerid, vx, vy, vz+5);
Reply
#3

Thanks, but I am new to pawn, how do I say like

If button push + {
code
}
Reply
#4

bumppppp
Reply
#5

Quote:
Originally Posted by KennethRandall
Посмотреть сообщение
pawn Код:
new Float:vx, Float:vy, Float:vz;
GetVehicleVelocity(playerid, vx, vy, vz);
SetVehicleVelocity(playerid, vx, vy, vz+5);
That won't help it's for the speed boost.
Try with setting the vehicle position.
pawn Код:
new Float:px, Float:py, Float:pz;
VehicleID = GetPlayerVehicleID(playerid);
GetVehiclePos(VehicleID, px, py, pz);
SetVehiclePos(VehicleID, px, py, pz+15);
return 1;
}
About the keys, check
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange .
Reply
#6

Thanks, but is there something I have to include? cause i have an error for each button push
Код:
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(53) : error 017: undefined symbol "PRESSED"
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(65) : error 017: undefined symbol "PRESSED"
Код:
	//nos
	if (PRESSED(KEY_FIRE))
	{
		new
			vehicleid = GetPlayerVehicleID(playerid);
		if (vehicleid)
		{
			AddVehicleComponent(vehicleid, 1010);
		}
	}
	//nos
	
	//superjump
	if (PRESSED(KEY_JUMP))
	{
		new
			Float:x,
			Float:y,
			Float:z;
		GetPlayerPos(playerid, x, y, z);
		SetPlayerPos(playerid, x, y, z + 10.0);
	}
	//superjump
Reply
#7

nvm, found it xD Thanks for the help. Just one more quick question, what is the + key by default?

And I am getting the following errors on the code

Код:
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(71) : error 017: undefined symbol "GetVehicleVelocity"
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(72) : error 017: undefined symbol "SetVehicleVelocity"
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(70) : warning 203: symbol is never used: "vy"
C:\Users\Nathan\Desktop\samp server\gamemodes\HsgStuntages.pwn(70) : warning 203: symbol is never used: "vx"
Reply


Forum Jump:


Users browsing this thread: