OnPlayerSprint?
#9

Quote:
Originally Posted by d1git
Посмотреть сообщение
I just updated the code, it should work now - typo basically.

PHP код:
new sprint[MAX_PLAYERS]; 
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \ 
    
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) 
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if(
PRESSED(KEY_SPRINT)) 
    { 
        
sprint[playerid] = 1// Player pressed the sprint key 
    

    if(
RELEASED(KEY_SPRINT)) 
    { 
        
sprint[playerid] = 0// Player letgo of the sprint key 
    

    return 
1

So it's currently detecting if the player press on SPACE etc but if he's just standing? how can i make sure it detects when he's running? i've an idea, maybe if he's pressing on the KEY_SPRINT + W or S or A or D. how can i do it?
Reply


Messages In This Thread
OnPlayerSprint? - by Lirbo - 17.01.2016, 17:30
Re: OnPlayerSprint? - by PrO.GameR - 17.01.2016, 17:36
Re: OnPlayerSprint? - by Lirbo - 17.01.2016, 17:41
Re: OnPlayerSprint? - by Pottus - 17.01.2016, 18:14
Re: OnPlayerSprint? - by -CaRRoT - 17.01.2016, 18:55
Re: OnPlayerSprint? - by d1git - 17.01.2016, 18:59
Re: OnPlayerSprint? - by Lirbo - 17.01.2016, 19:11
Re: OnPlayerSprint? - by d1git - 17.01.2016, 19:13
Re: OnPlayerSprint? - by Lirbo - 17.01.2016, 19:25
Re: OnPlayerSprint? - by d1git - 17.01.2016, 19:27

Forum Jump:


Users browsing this thread: 3 Guest(s)