Random number in a dialog text
#1

What I want to do is have a random number generated, and have it shown in a dialog text, how would I do this (no plugins)?

pawn Код:
new randomnumber=rand(1000);
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, "Your number is (randomnumber HERE)", "Continue", "Leave");
Reply
#2

pawn Код:
new randomnumber=rand(1000); //(0-999)
new str[19];
format(str, sizeof str, "Your number is %d", randomnumber);
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, str, "Continue", "Leave");
Reply
#3

new number[32];
format(number, sizeof(number), "Your number is %i", random(1000));
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, number, "Continue", "Leave");
Reply
#4

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
new randomnumber=rand(1000); //(0-999)
new str[19];
format(str, sizeof str, "Your number is %d", randomnumber);
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_LIST, str, "Continue", "Leave");
This is what I was looking for, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)