#define DIALOG_GAMBLE1 1 #define DIALOG_GAMBLE2 2 #define DIALOG_GAMBLE3 3 if (strcmp("/gamble", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, DIALOG_GAMBLE1, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries", "Pull", ""); return 1; public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_GAMBLE1) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE2, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples", "Pull", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE2, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples", "Pull", ""); } return 1; } if(dialogid == DIALOG_GAMBLE2) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE3, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples {D0DB00}Bananas", "Exit", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE3, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples {D0DB00}Bananas", "Exit", ""); } return 1; } if(dialogid == DIALOG_GAMBLE3) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { if(Money[playerid] < 100) return SendClientMessage(playerid,0xFF0000FF,"You do not even have $100! You cheated in the Casino! You are now wanted by the Police."); SendClientMessage(playerid,0xFF0000FF,"You have lost from the {0004FF}Fruit {FF00FF}Slot {91FF00}Machine! You lost $100. Good luck next time!"); GivePlayerMoney(playerid,-100); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE3, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "~r~Berries ~g~Apples ~r~Strawberrys", "Exit", ""); } return 1; } if(dialogid == DIALOG_MAKEADMIN) { if(response) // MakeMeAdmin (if they clicked 'Send', or pressed Enter) { SendClientMessage(playerid,0xFF0000FF,"[ADMIN]: Wrong Code!"); } else // MakeMeAdmin (if they pressed ESC, or clicked 'Cancel') { SendClientMessage(playerid,0xFF0000FF,"[ADMIN]: You have canceled the MakeMeAdmin."); } return 1; } return 0; } |
if (strcmp("/gamble", cmdtext, true, 10) == 0)
{
new rand = 1 + random(3);
ShowPlayerDialog(playerid, rand, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries", "Pull", "");
return 1;
if( strcmp( "/gamble", cmdtext, true, 10 ) == 0 )
{
switch( random( 3 ) )
{
case DIALOG_GAMBLE1: ShowPlayerDialog( playerid, DIALOG_GAMBLE1, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries", "Pull", "" );
case DIALOG_GAMBLE2: ShowPlayerDialog( playerid, DIALOG_GAMBLE1, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries", "Pull", "" );
case DIALOG_GAMBLE3: ShowPlayerDialog( playerid, DIALOG_GAMBLE1, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries", "Pull", "" );
}
return ( 1 );
}