Help With OnPlayerKeyStateChange
#1

Hey I recently made like when you press lmb it lifts the car in the air
I went to
https://sampwiki.blast.hk/wiki/GetPlayerKeys
But I didnt find the caps lock function! Anybody know what it is called?
Reply
#2

i tried that to it didnt work, even if u would copy and paste what it shows there it wouldnt work, i think the wiki is fucked....
Reply
#3

No I just want what its called like KEY_FIRE but with the caps btw i got it working!
Reply
#4

This might help you dude http://pastebin.com/5UBQXRev
Reply
#5

Any response!
Reply
#6

that helps but i wanted multi pressed keys
Reply
#7

onplayerkeystatechange
new string[128];
format string newkeys);
sendclientmessage string


this way you can see what the number for every key is, and you can also see what keys work in vehicle and on foot.
when you press more then one key (example: key 512 and 128, you just need to add the numbers, so it'll be 640)
Reply
#8

So fallout is 128 the caps lock key?
Reply
#9

no,

https://sampwiki.blast.hk/wiki/GetPlayerKeys
here's a full list of all keys
Reply
#10

At the top of your script:

pawn Код:
#define KEY_HORN 2
Now, under OnPlayerKeyStateChange:

pawn Код:
if(newkeys && KEY_HORN && oldkeys && 1024)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
             SendClientMessage(playerid,COLOR_WHITE,"You must be inside a vehicle to use this.");
             return 1;
        }
        new Float:X,Float:Y,Float:Z;
        GetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z);
        SetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z+(Z / 4));
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)