04.08.2014, 16:19
I need an example only.
as I can recall a DIALOG only once?.
the second time you call it is not possible.
as I can recall a DIALOG only once?.
the second time you call it is not possible.
//On the top of gamemode
new Cancall[MAX_PLAYERS];
//Then in your script you will add:
if(Cancall[playerid] == 1) { //script here and then add in your script the next
Cancall[playerid] = 0;
#define MAX_DIALOGS_USED 10
new bool:DialogUsed[MAX_PLAYERS][MAX_DIALOGS_USED];
// Disalow a player to use the dialog 5 again:
DialogUsed[playerid][5] = true;
// Checking:
if(DialogUsed[playerid][5] == true) SendClientMessage(playerid, 0xFFFFFFFF, "You can't use the dialog 5 again!")
#include <a_samp>
#define RAND_DIALOG0 0
#define RAND_DIALOG1 1
// etc
new bool: pDialogUsed[MAX_PLAYERS][5];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/randomdialog", cmdtext, true, 10) == 0)
{
jump:
switch(random(5))
{
case 0:
{
if(pDialogUsed[playerid][0] == false)
{
ShowPlayerDialog(playerid, RAND_DIALOG0, DIALOG_STYLE_MSGBOX, "Insert Info Here", "Random Dialog 0", "Select", "Select");
}
else goto jump;
}
case 1:
{
// etc
}
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == RAND_DIALOG0)
{
if(response || !response)
{
pDialogUsed[playerid][0] = true;
// do some stuff
}
return 1;
}
return 0;
}