Advertisement
ghostbalkan

Untitled

Nov 14th, 2017
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.88 KB | None | 0 0
  1. #include "a_samp"
  2. #include "YSI\y_commands"
  3. #include "sscanf2"
  4. main(){}
  5. enum JobInfo
  6. {
  7.     POSAO_BUS
  8.     //POSAO_BLABLA,
  9.     //POSAO_KURCINA itd
  10. }
  11. new jobPay[JobInfo];
  12.  
  13. public OnGameModeInit()
  14. {
  15.     jobPay[POSAO_BUS] = 2000;
  16.     //jobPay[POSAO_BLABLA] = 5000;
  17.     //jobPay[POSAO_KURCINA] = 550205;
  18.     return 1;
  19. }
  20.  
  21. CMD:plate(playerid, params[])
  22. {
  23.     ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Plate", "Podesi plate\nTrenutne plate", "Odaberi", "Izlaz");
  24.     return 1;
  25. }
  26.  
  27. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  28. {
  29.     if(dialogid == 1)
  30.     {
  31.         if(response)
  32.         {
  33.             switch(listitem)
  34.             {
  35.                 case 0:
  36.                 {
  37.                     ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Podesi plate", "Posao bus vozac", "Odaberi", "Izlaz");
  38.                 }
  39.                 case 1:
  40.                 {
  41.                     new string[20];
  42.                     format(string, sizeof(string), "Bus vozac - %d...",jobPay[POSAO_BUS]);
  43.                     SendClientMessage(playerid, -1, string);
  44.                 }
  45.             }
  46.         }
  47.     }
  48.     if(dialogid == 2)
  49.     {
  50.         if(response)
  51.         {
  52.             switch(listitem)
  53.             {
  54.                 case 0:
  55.                 {
  56.                     ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
  57.                    
  58.                 }
  59.             }
  60.         }
  61.     }
  62.     if(dialogid == 3)
  63.     {
  64.         if(response)
  65.         {
  66.             new iznos, string[100];
  67.             if(strfind(inputtext, "%", true) != -1) return SendClientMessage(playerid, -1, "Samo brojeve koristi");
  68.             if(sscanf(inputtext, "i", iznos)) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
  69.             if(iznos <= 1000 || iznos >= 20001) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
  70.             jobPay[POSAO_BUS] = iznos;
  71.             format(string, sizeof(string), "Plata od Bus vozaca je postavljena na %d$", iznos);
  72.             SendClientMessageToAll(-1, string);
  73.         }
  74.     }
  75.     return 1;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement