Lol please help - 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: Lol please help (
/showthread.php?tid=170860)
Lol please help -
bartje01 - 24.08.2010
Guys please help :P
I want that you can do something when you push F or ENTER on your keyboard.
How does this function work?
Never did something with it. that's whyI''m asking
Thanks
Re: Lol please help -
[XST]O_x - 24.08.2010
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange -- The public that checks if player has pressed any buttons.
https://sampwiki.blast.hk/wiki/GetPlayerKeys -- Scroll a little bit down to see the key list.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK) // KEY_SECONDARY_ATTACK is enter/f.
{
SendClientMessage(playerid,0x00FFFFFF,"You have pressed enter!");
}
return 1;
}
Re: Lol please help -
RSX - 24.08.2010
Second way:
1. Check all the time if player is using this key, for example, KEY_FIRE (likely to be ctrl), keys differ onfoot/invehicle
Forkilling=SetTimer("Function'sName", from 200 till 500, Repeat most likely 1);
pawn Код:
public FunctionsName(playerid, keys, updown, leftright)
{
new keys, updown, leftright;
GetPlayerKeys(playerid, keys, updown, leftright);
if(keys&KEY_FIRE) OR if(keys==KEY_FIRE)
{
//ToDo
if(DoneAll) KillTimer(Forkilling);
}
}
Re: Lol please help -
Dime - 24.08.2010
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
EDIT:i was making topic,so didnt see before me ppl posted sry
Re: Lol please help -
bartje01 - 24.08.2010
Ye thanks guys :P