Bob_Marley

[PAWNO] Dynamic system of lottery

Oct 22nd, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.77 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnPlayerCommandText(playerid, cmdtext[]) {
  4.     if(strcmp(cmdtext, "/lotto", true) == 0)return ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Lotto","\
  5.     Чтобы приобрести билет нажмите - Купить.\
  6.     ","Купить","Выход");
  7.     return 1;
  8. }
  9.  
  10. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  11. {
  12.     switch(dialogid)
  13.     {
  14.         case 10:
  15.         {
  16.             if (response)
  17.             {
  18.                 GivePlayerMoney(playerid,-1000);
  19. new rand = random(9999), string[225];
  20.                 format(string,sizeof(string),"Ты выииграл %d$. Поздравляем!",rand);
  21.                 SendClientMessage(playerid,0x33AA33,string);
  22.                 return GivePlayerMoney(playerid,rand);
  23.             }    
  24.         }
  25.     }  
  26.     return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment