SA-MP Forums Archive
Dialog listitem update - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog listitem update (/showthread.php?tid=600220)



Dialog listitem update - fuckingcruse - 05.02.2016

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?



Re: Dialog listitem update - Rufio - 05.02.2016

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.


Re: Dialog listitem update - fuckingcruse - 05.02.2016

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.


Re: Dialog listitem update - Rufio - 05.02.2016

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.


Re: Dialog listitem update - fuckingcruse - 05.02.2016

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?



Re: Dialog listitem update - Rufio - 05.02.2016

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.


Re: Dialog listitem update - fuckingcruse - 05.02.2016

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.


Re: Dialog listitem update - Rufio - 05.02.2016

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


Re: Dialog listitem update - fuckingcruse - 05.02.2016

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.


Re: Dialog listitem update - fuckingcruse - 06.02.2016

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?