Dialog listitem update
#1

Hey , if
Код:
new Dialog_value[MAX_PLAYERS]; 
//On some work , 
Dialog_value[MAX_PLAYERS] = 1; 
//MAX_PLAYERS BECAUSE its for the full server.
then the listitem case 0 must be blank " " that means it must be removed. How can i do it?
Reply
#2

Like this?
PHP код:
if(listitem == 0) {
// notice that I havent put anything here, so listitem 0 wont do anything for the player.

Not sure if it is what you are asking for.
Reply
#3

I know that thing but , How can i remove that lit item? Does nothing will make the dialog dirty or ugly. I want to remove it.
Reply
#4

Delete it from showplayerdialog, it should be the very first option. Bear in mind each option is separated from eachother with a "/n" without the quotation marks.
Reply
#5

I even had 1 more doubt like
Код:
new dialog_example[]
{
//some text
};
new dialog_example2[]
{
//some text
};
new dialog_example3[]
{
//some text
};
now i make few dialogs ShowPlayerDialog(playerid,ID,DIALOG_STYLE_LIST,"Example",dialog_example1,"Close","");
ShowPlayerDialog(playerid,ID,DIALOG_STYLE_LIST,"Example",dialog_example2,"Close","");
ShowPlayerDialog(playerid,ID,DIALOG_STYLE_LIST,"Example",dialog_example3,"Close","");
Now how can i send a random dialog from any of these when player connects?
and can i use the new values in dialog like i did?
Reply
#6

Define a rand local variable for max_players, assign the rand variable to the random function so it should look like this;

PHP код:
new rand[MAX_PLAYERS];
rand[playerid] = random(2); // Bear in mind the fact that you can only script 3 dialogs with this. One being '0', the other being '1', the other being '2'
if(rand[playerid] == 0) { // if the randomized number is 0 then
// showplayerdialog here

if(
rand[playerid] == 1) { //  same as above
//showplayerdialog here
}
if(
rand[playerid] == 2) { // same as above
//showplayerdialog here

You have to use these functions under OnPlayerConnect for the codes to work as you want them to work.
Reply
#7

So I will write ShowPlayerDialog(playerid,blah ,blah "DialogExample", rand," close" , ""); right? Or how do I show that rand dialog? . Your codes defines the dialog before itself. And I don't want the new to have ShowPlayerDialog , but the text of the dialog that will be in list. And dialog on player connect.
Reply
#8

Oh wait, do you want to randomize what dialogs writings consist of instead of randomizing dialogs themselves?
Reply
#9

Yes you got me. I have thought of something but I don't think it may work so I came here to ask it. Let me know the solution for it. Good day.
Reply
#10

Like the info in the dialog must be random. And how can i do it? Even if we can do it then how can i get that if it's the dialog_example then the list item must do this. If its dialog_example2 then the list item must do this?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)