23.01.2013, 15:14
(
Last edited by SilverKiller; 23/01/2013 at 04:23 PM.
)
FIXED!
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;
Try:
Code:
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; |
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; }
Code:
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; } |
#define DIALOG_RULES 2
ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_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;
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;
}
switch(dialogid) { case 1: // /drink dialog { // Code here } case 2: // Rules Dialog { // Code here } }