Dialogs,timers etc.
#1

Is it possible when I click an dialog to use timer (ex.: 10 secs) and after 10 seconds the another dialog to appear ? If its please tell me how to do it .
Reply
#2

i.e. if it's a menu dialog and the first menu item says 10 seconds I click it and after 10 seconds another (message dialog) appears and says 10 seconds passed.
Reply
#3

Yup.

pawn Код:
SetTimerEx("OpenDialog",10000,false,"ii",playerid,dialogid);
pawn Код:
forward OpenDialog(playerid,dialogid);

public OpenDialog(playerid,dialogid)
{
    switch(dialogid)
    {
        case 1000: ShowPlayerDialog(playerid,1001,DIALOG_STYLE_MSGBOX,"Test","10 seconds have passed!","Ok","");
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Yup.

pawn Код:
SetTimerEx("OpenDialog",10000,false,"ii",playerid,dialogid);
pawn Код:
forward OpenDialog(playerid,dialogid);

public OpenDialog(playerid,dialogid)
{
    switch(dialogid)
    {
        case 1000: ShowPlayerDialog(playerid,1001,DIALOG_STYLE_MSGBOX,"Test","10 seconds have passed!","Ok","");
    }
    return 1;
}
Ty a lot Rep+ because the fast response
Reply
#5

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Yup.

pawn Код:
SetTimerEx("OpenDialog",10000,false,"ii",playerid,dialogid);
Do I need sscanf for this part ?
Reply
#6

Quote:
Originally Posted by x96664
Посмотреть сообщение
Do I need sscanf for this part ?
no you dont need
Reply
#7

Quote:
Originally Posted by x96664
Посмотреть сообщение
Do I need sscanf for this part ?
SetTimerEx is a default samp function. Look it up on the wiki if you're confused by something.


Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
Oh wait,

pawn Код:
SetTimerEx("OpenDialog",10000,false,"i",playerid,dialogid);
This should work i think.
The first one was correct. "ii" because you have two integer arguments
Reply
#8

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
The first one was correct. "ii" because you have two integer arguments
Yes i know i edited the post sorry.
Reply
#9

error 017: undefined symbol "playerid" for this line SetTimerEx("OpenDialog",10000,false,"ii",playerid, dialogid);
Reply
#10

you could just do this
pawn Код:
SetTimer("OpenDialog",10000,1);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)