On Player Key State Change - 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)
+--- Thread: On Player Key State Change (
/showthread.php?tid=429092)
On Player Key State Change -
Beljulji - 08.04.2013
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, "");
Re: On Player Key State Change -
Beljulji - 08.04.2013
anyone know?
Re: On Player Key State Change -
Deal-or-die - 08.04.2013
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;
}
Re: On Player Key State Change -
Beljulji - 08.04.2013
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?
Re: On Player Key State Change -
Deal-or-die - 08.04.2013
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
Re : On Player Key State Change -
dangerkiller - 23.11.2014
https://sampwiki.blast.hk/wiki/Keys
Re: On Player Key State Change -
Abagail - 23.11.2014
Don't bump a year old thread.