How to detect Left Shift inside vehicle?
#1

Well, my question is simple. How do i detect when player press Left shift inside a vehicle? detecting KEY_JUMP is not working, also it says it takes no effect inside vehicle on GetPlayerKeys in wiki.

But i've seen many scripts starting car engine at Left Shift.. :/

Thanks
Reply
#2

Keys are different in vehicle. Add a print statement in OnPlayerKeyStateChange to print the values of the keys. Then go in a vehicle and press Left Shift to see what it returns.
Reply
#3

Any tip on how to get that value? I mean, what should i make it print.
Reply
#4

Take a look at the whole page,it's interesting,I mean you are provided with the value of every key...
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#5

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Take a look at the whole page,it's interesting,I mean you are provided with the value of every key...
https://sampwiki.blast.hk/wiki/GetPlayerKeys
I did, there is no information about what key to use, in case i want Shift inside vehicle.
Reply
#6

Did you see the table with all keys values and THEIR NAME for OnFoot state and OnVehicle STATE?Basically did you scroll down?
Reply
#7

I mean like:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    printf("[debug] OnPlayerKeyStateChange(playerid = %d, newkeys = %d, oldkeys = %d)", playerid, newkeys, oldkeys);
    // rest of code
}
Then just look what it returns for newkeys when you press LSHIFT in vehicle.
Reply
#8

Will try that Vince. Thank you.
Reply
#9

If i am outside it prints the key, otherway it just don't do anything. ;(
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)