Hi guys! Help?
#1

I saw at gamerx server that you can fly(jump) by pressing h key. How can I do it? I wanna fly at my server too
Reply
#2

Код:
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		if (PRESSED(KEY_CROUCH))
		{
    	new Float:x, Float:y, Float:z;
			GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
			SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
		}
	}
That's how I do it.
Add it in OnPlayerKeyStateChange
Reply
#3

Quote:
Originally Posted by Faraday
Код:
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		if (PRESSED(KEY_CROUCH))
		{
    	new Float:x, Float:y, Float:z;
			GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
			SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3);
		}
	}
That's how I do it.
Add it in OnPlayerKeyStateChange
error 017: undefined symbol "PRESSED"
Reply
#4

Quote:
Originally Posted by lionlev
error 017: undefined symbol "PRESSED"
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#5

or
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Reply
#6

Quote:
Originally Posted by Faraday
or
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
I am new to pawno, so where do I put the define?
Reply
#7

Quote:
Originally Posted by lionlev
Quote:
Originally Posted by Faraday
or
Код:
#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
I am new to pawno, so where do I put the define?
nvm, I got it. But I am not jumping with cars.... Why it's doesn't work?
Reply
#8

Show your OnPlayerKeyStateChange code.
Reply
#9

Quote:
Originally Posted by Faraday
Show your OnPlayerKeyStateChange code.
nvm It working... I though I have to press on crouch key to jump, but I have to press on horn key :P Thanks
Reply
#10

Horn key = KEY_SPRINT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)