SA-MP Forums Archive
How to make authokeys? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make authokeys? (/showthread.php?tid=184423)



How to make authokeys? - knackworst - 19.10.2010

How can I make a command a autokhey in PAWN?


Re: How to make authokeys? - Mauzen - 19.10.2010

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.


Re: How to make authokeys? - legodude - 19.10.2010

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)


Re: How to make authokeys? - Voldemort - 19.10.2010

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.


Re: How to make authokeys? - Mauzen - 19.10.2010

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


Re: How to make authokeys? - knackworst - 19.10.2010

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


Re: How to make authokeys? - Sascha - 19.10.2010

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)


Re: How to make authokeys? - LarzI - 19.10.2010

KEY_CROUCH is the car horn.


Respuesta: How to make authokeys? - The_Moddler - 19.10.2010

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


Re: Respuesta: How to make authokeys? - Sascha - 19.10.2010

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


Respuesta: Re: Respuesta: How to make authokeys? - The_Moddler - 19.10.2010

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.