How to detect?
#1

Hello, i don't need nothing, just simple link with a tut and i have tried to search

Anyways, how to detect if let's say.. i pressed Y and it shows me dialog?
Reply
#2

Code:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_YES))
    {
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "test","You pressed Y!","Ok","Close");
    }
    return 1;
}
At the top of script:

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Search more Keys right here!
Reply
#3

it's simple. no tutorial needed be cause it's done in less lines:
pawn Код:
#define ANY_DIALOG 0

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
     if(newkeys & KEY_YES)
     {
             ShowPlayerDialog(..); // show dialog code
     }
     return 1;
}
P.S: this 'Y' button dosen't work on spectating mode.

EDIT: i'm late i guess :V
Reply
#4

Ah thanks)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)