How to make authokeys?
#1

How can I make a command a autokhey in PAWN?
Reply
#2

Wtf is a autohotkey?

Hm, whatever, you can only use the existing keys https://sampwiki.blast.hk/wiki/GetPlayerKeys
Other cant be accessed from a script.
OnPlayerKeyStateChange is called, when one of them is pressed/released, you can create hotkeys with this.
Reply
#3

wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

edit @ mauzen:

you actually can check for other keys i believe. you just need to know the keycode.(not too sure bbout this)
Reply
#4

Quote:
Originally Posted by legodude
Посмотреть сообщение
wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

edit @ mauzen:

you actually can check for other keys i believe. you just need to know the keycode.(not too sure bbout this)
You can ONLY assign keys, which is used by SA, you can't "guess" key codes, because in samp they dont exist.
Reply
#5

Quote:
Originally Posted by legodude
Посмотреть сообщение
wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

edit @ mauzen:

you actually can check for other keys i believe. you just need to know the keycode.(not too sure bbout this)
Not yet, maybe int later versions (i hope so ) all valid keycodes are listed in a_samp.inc
Reply
#6

with authokeys i mean like, you press the horn to flip your car, etc...
Reply
#7

I guess it will be possible in the future someday to use random keys...
however for the horn I guess it's the submission key...
Look on the website mauzen sent, there is a "released" code somewhere lower on the site, copy this code and then you can use something like this:
Код:
if(RELEASED(KEY_SUBMISSION)){
if(IsPlayerInAnyVehicle(playerid)){
new v = GetVehicleID(playerid), Float:a;
GetVehicleZAngle(v, a);
SetVehicleZAngle(v, a);
}
}
this code at OnPlayerKeyStateChange or so...

(I don't know whether this works or not as I just wrote it up)
Reply
#8

KEY_CROUCH is the car horn.
Reply
#9

I think SetVehicleZAngle(v, 180); will unflip it..
Reply
#10

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
I think SetVehicleZAngle(v, 180); will unflip it..
the ZAngle is the same as the player's facing angle....

so like: left and right
not up and down...

try it yourself and you'll see
Reply
#11

Quote:
Originally Posted by Sascha
Посмотреть сообщение
the ZAngle is the same as the player's facing angle....

so like: left and right
not up and down...

try it yourself and you'll see
It will work then..

https://sampwiki.blast.hk/wiki/SetVehicleZAngle

And Z angle is rotation.. that's what you use to unflip a car.

EDIT:

When you set the vehicle angle, it will get unflipped, so you need to get the vehicle angle first.. like in Wiki.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)