Who can help me
#1

How to press key as in this video https://www.youtube.com/watch?time_c...&v=jtwl1ZATR6c
Reply
#2

Use the keyboard numpad:
Reply
#3

Quote:
Originally Posted by cuber
Посмотреть сообщение
Use the keyboard numpad:
My intention is to make this system for SA-MP
Reply
#4

Quote:
Originally Posted by hoanduy
Посмотреть сообщение
My intention is to make this system for SA-MP
You didn't say that earlier.
Reply
#5

Look, this can be done, Set it as a minigame go check my minigame tutorial to know the basic concept, put the players in the cars and lock them in or do if a player exits car = lose and exit, then you can check it through OnPlayerKeyStateChange, give players instructions on-screen with textdraws or gametexts then detect those instructions through OnPlayerKeyStateChange and give them points every time they press the right key at the right time, how to do that? new KeysPressed[MAX_PLAYERS]; then say for ex, you want the order to be up up down right left left up , okay? check SAMP KEYS to know the keys then for ex at OnPlayerKeyStateChange check for all of the keys, up down left and right (analog) then do if KeysPressed[playerid] ==0 this is the first key pressed if you want it up then put that under up and do KeysPressed[playerid]++; then apply this concept for all keys and the player who hits the score you want( hitting the last key) wins, this is very possible.
PS: don't forget to turn the car's engine off and force it off until the minigame ends so that they can only move the car but not change its xyz pos.
EDIT: i'm interested in this, if i ever make this minigame/event i will release it and mention you.
Reply
#6

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Look, this can be done, Set it as a minigame go check my minigame tutorial to know the basic concept, put the players in the cars and lock them in or do if a player exits car = lose and exit, then you can check it through OnPlayerKeyStateChange, give players instructions on-screen with textdraws or gametexts then detect those instructions through OnPlayerKeyStateChange and give them points every time they press the right key at the right time, how to do that? new KeysPressed[MAX_PLAYERS]; then say for ex, you want the order to be up up down right left left up , okay? check SAMP KEYS to know the keys then for ex at OnPlayerKeyStateChange check for all of the keys, up down left and right (analog) then do if KeysPressed[playerid] ==0 this is the first key pressed if you want it up then put that under up and do KeysPressed[playerid]++; then apply this concept for all keys and the player who hits the score you want( hitting the last key) wins, this is very possible.
PS: don't forget to turn the car's engine off and force it off until the minigame ends so that they can only move the car but not change its xyz pos.
EDIT: i'm interested in this, if i ever make this minigame/event i will release it and mention you.
But how to press the right time, that is what I'm afraid
Reply
#7

didn't you just read what i said man, here is an example code:
PHP код:
new KeyPressed[MAX_PLAYERS];

#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
    
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_ANALOG_RIGHT))
    {
        if(
KeyPressed[playerid] ==0)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_DOWN))
    {
        if(
KeyPressed[playerid] ==1)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_LEFT))
    {
        if(
KeyPressed[playerid] ==2)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_UP))
    {
        if(
KeyPressed[playerid] ==3)
        {
            
KeyPressed[playerid]++;
            }
        }
    return 
1;

this is an example of right down left up in the exact order.
Reply
#8

I think he meant Marquee arrows and to check if its inside the middle circle or not when a user presses a particular key. after that, your code comes to check weather the key pressed is correct one or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)