On Player Key State Change
#1

well im trying to make command for cars when you press h server type /service but idk what definition is for H in vehicle anyone know?
Код:
if (newkeys == WHAT SHOULD I PUT HERE?)cmd_service(playerid, "");
Reply
#2

anyone know?
Reply
#3

Not sure if this is what you were after?

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED( KEY_CTRL_BACK ))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "/service");
        }
    }
    return 1;
}
Reply
#4

dude i just need a definition for key "H" i have command i just want to make it like commamd i post.
and btw why did you add SendClienMessage?
Reply
#5

Try ****** next time bro and don't be such a smart ass about it. It's not as if I HAVE to try help you.

"and btw why did you add SendClienMessage?"
Because after trying to decipher your sentence/English I assumed you wanted the server to send the client the message saying '/service'


I believe you're after 'KEY_CTRL_BACK'

https://sampwiki.blast.hk/wiki/Keys
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#6

https://sampwiki.blast.hk/wiki/Keys
Reply
#7

Don't bump a year old thread.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)