GetPlayerKeys: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=Gets the keys pressed down by the specified player, who is streamed in.| params=<source lang="lua">playerid</source> <poem>::playerid : The ID of the player wh...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
params=<source lang="lua">playerid</source>
params=<source lang="lua">playerid</source>
<poem>::playerid : The ID of the player whose keys pressed down you want to obtain.</poem>|
<poem>::playerid : The ID of the player whose keys pressed down you want to obtain.</poem>|
retvals=The keys(same as that returned by player.Key or onPlayerGameKeysChange used in server) of the specified player. Returns '''-1''' if the player does not exist.|
retvals=The [[keys]](same as that returned by player.Key or onPlayerGameKeysChange used in server) of the specified player. Returns '''-1''' if the player does not exist.|
example=<source lang="lua">
if( GetPlayerKeys(id) & KEY_ONFOOT_FIRE )
{
SendChat("Please don't kill me.");
}</source>|
}}
}}

Latest revision as of 13:45, 25 March 2022


Description:
Gets the keys pressed down by the specified player, who is streamed in.


Parameters:

playerid

playerid : The ID of the player whose keys pressed down you want to obtain.


Return Values:
The keys(same as that returned by player.Key or onPlayerGameKeysChange used in server) of the specified player. Returns -1 if the player does not exist.


Example

if( GetPlayerKeys(id) & KEY_ONFOOT_FIRE )
{ 
SendChat("Please don't kill me.");
}