PDA

View Full Version : Dialog Problem


SilverKiller
23/01/2013, 03:14 PM
FIXED!

Blackazur
23/01/2013, 03:33 PM
Try:

if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid);
}
return 1;
}

return 0;

SilverKiller
23/01/2013, 03:37 PM
Try:

if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid);
}
return 1;
}

return 0;

Not working

coakiddo
23/01/2013, 03:38 PM
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid);
}
else if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
return 1;
}Try this, I'm not sure if it works.

SilverKiller
23/01/2013, 03:41 PM
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid);
}
else if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
return 1;
}Try this, I'm not sure if it works.

Still not working, No already works fine, but when i click yes nothing happens it only gets me to the skin selection and it should send a client message

EDIT: I also tried to put it under OnPlayerSpawn (i have it under OnPlayerConnect) but OnPlayerSpawn Does the same thing, it doesnt get me to the class selection, it only does nothing.

SilverKiller
23/01/2013, 03:51 PM
Any solution?

SilverKiller
23/01/2013, 04:03 PM
Oh, and i forgot, i have another Dialog with another ID, but the dialog works fine and is not bugged, here is the code for both dialogs

#define DIALOG_RULES 2
ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYL E_MSGBOX,"Server Rules!","No Cheating\n- No Spamming\n- Respect Admins\n\nDo you agree to these rules?","Yes","No"); // under on player connect

}
if(!strcmp(cmdtext, "/drinks", true))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drinks For Only 1 , 2 ,3 $", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
return 1;

Now OnDialogResponse For both:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1:
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2:
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
}
return 1;

#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
}
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid);
}
else if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); //problem
}
return 1;
}

return 0;
}

Compiles with no errors, but still not working, also tried to make it else only, still nothing happens

coakiddo
23/01/2013, 04:06 PM
switch(dialogid)
{
case 1: // /drink dialog
{
// Code here
}
case 2: // Rules Dialog
{
// Code here
}
}
Use it like this, you really messed up that code.

SilverKiller
23/01/2013, 04:15 PM
Wait, i fixed it!

I removed the return 1; at the end of the drinks dialog and now they both work