GetPlayerKeys
#1

Hi

I want in onplayerupdate getplayerkeys for ex if player press key_fire key_jump.
Reply
#2

Use 'OnPlayerKeyStateChange' (wiki link: https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange)

Here's an example

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
GetPVarInt(playerid"InAnimation") >= && (newkeys KEY_SPRINT) && !(oldkeys KEY_SPRINT))
    {
        if(
GetPVarInt(playerid"LoopingAnim") >= 1StopLoopingAnim(playerid);
        else 
        {
            
ClearAnimations(playerid);
            
DeletePVar(playerid"InAnimation");
        }
        
TextDrawHideForPlayer(playerid,AnimationHelper);
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)