SA-MP Forums Archive
Scripting Question - 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: Scripting Question (/showthread.php?tid=523809)



Scripting Question - Genmetal - 04.07.2014

Whats callback called when players walks/moving ?


Respuesta: Scripting Question - SickAttack - 04.07.2014

There isn't a callback that does that but you can use GetPlayerKeys to detect if a players presses W, A, S or D.

https://sampwiki.blast.hk/wiki/GetPlayerKeys


Re: Scripting Question - Threshold - 04.07.2014

pawn Код:
public OnPlayerUpdate(playerid)
{
    new Keys, ud, lr;
    GetPlayerKeys(playerid, Keys, ud, lr);
    if(ud == KEY_UP) //Player is pressing 'UP or W' (By default)
    else if(ud == KEY_DOWN) //Player is pressing 'DOWN or S' (By default)
 
    if(lr == KEY_LEFT) //Player is pressing 'LEFT or A' (By default)
    else if(lr == KEY_RIGHT) //Player is pressing 'RIGHT or D' (By default)
    return 1;
}
Source:
https://sampwiki.blast.hk/wiki/GetPlayerKeys
https://sampwiki.blast.hk/wiki/OnPlayerUpdate
https://sampwiki.blast.hk/wiki/Keys