10.09.2012, 18:16
Код:
{ 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_GAMBLE2,DIALOG_STYLE_MSGBOX,"{0004FF}Fruit {FF00FF}Slot {91FF00}Machine","{B34242}Bananas","Pull",""); case DIALOG_GAMBLE3: ShowPlayerDialog(playerid,DIALOG_GAMBLE3,DIALOG_STYLE_MSGBOX,"{0004FF}Fruit {FF00FF}Slot {91FF00}Machine","{B34242}Apples","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_GAMBLE5, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples", "Pull", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE5, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Berries {91FF00}Apples", "Pull", ""); } } if(dialogid == DIALOG_GAMBLE2) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE4, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{B34242}Bananas {91FF00}Apples", "Pull", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE4, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Bananas {D0DB00}Apples", "Pull", ""); } } if(dialogid == DIALOG_GAMBLE3) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE6, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Apples {91FF00}Apples", "Pull", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE6, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Apples {91FF00}Apples", "Pull", ""); } } 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."); } } if(dialogid == DIALOG_GAMBLE4) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE8, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Bananas {91FF00}Apples {91FF00}Bananas", "Exit", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE8, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Bananas {91FF00}Apples {91FF00}Bananas", "Exit", ""); } } if(dialogid == DIALOG_GAMBLE5) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE9, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Berries {91FF00}Apples {91FF00}Bananas", "Exit", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE9, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Berries {91FF00}Apples {91FF00}Bananas", "Exit", ""); } } if(dialogid == DIALOG_GAMBLE6) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { ShowPlayerDialog(playerid, DIALOG_GAMBLE7, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Apples {91FF00}Apples {91FF00}Apples", "Exit", ""); } else // Slot Machine (if they pressed ESC) { ShowPlayerDialog(playerid, DIALOG_GAMBLE7, DIALOG_STYLE_MSGBOX, "{0004FF}Fruit {FF00FF}Slot {91FF00}Machine", "{91FF00}Apples {91FF00}Apples {91FF00}Apples", "Exit", ""); } } if(dialogid == DIALOG_GAMBLE7) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { SendClientMessage(playerid,0xFF0000FF,"You won!"); } else // Slot Machine (if they pressed ESC) { SendClientMessage(playerid,0xFF0000FF,"You won!"); } } if(dialogid == DIALOG_GAMBLE8) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { SendClientMessage(playerid,0xFF0000FF,"You lost!"); } else // Slot Machine (if they pressed ESC) { SendClientMessage(playerid,0xFF0000FF,"You lost!"); ) } if(dialogid == DIALOG_GAMBLE9) { if(response) // Slot Machine (if they clicked 'Pull', or pressed Enter) { SendClientMessage(playerid,0xFF0000FF,"You lost!"); } else // Slot Machine (if they pressed ESC) { SendClientMessage(playerid,0xFF0000FF,"You lost!"); ) } return 0; }
Код:
C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(134) : warning 217: loose indentation C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(396) : warning 217: loose indentation C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(396) : error 029: invalid expression, assumed zero C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(398) : warning 217: loose indentation C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(407) : warning 217: loose indentation C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(407) : error 029: invalid expression, assumed zero C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(409) : warning 217: loose indentation C:\Documents and Settings\Fabian\My Documents\SAMP Scripting Tools\gamemodes\slotmachine8.pwn(411) : error 030: compound statement not closed at the end of file (started at line 389) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
Greetz, CrazyManiac.