Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "a_samp"
- #include "YSI\y_commands"
- #include "sscanf2"
- main(){}
- enum JobInfo
- {
- POSAO_BUS
- //POSAO_BLABLA,
- //POSAO_KURCINA itd
- }
- new jobPay[JobInfo];
- public OnGameModeInit()
- {
- jobPay[POSAO_BUS] = 2000;
- //jobPay[POSAO_BLABLA] = 5000;
- //jobPay[POSAO_KURCINA] = 550205;
- return 1;
- }
- CMD:plate(playerid, params[])
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Plate", "Podesi plate\nTrenutne plate", "Odaberi", "Izlaz");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Podesi plate", "Posao bus vozac", "Odaberi", "Izlaz");
- }
- case 1:
- {
- new string[20];
- format(string, sizeof(string), "Bus vozac - %d...",jobPay[POSAO_BUS]);
- SendClientMessage(playerid, -1, string);
- }
- }
- }
- }
- if(dialogid == 2)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
- }
- }
- }
- }
- if(dialogid == 3)
- {
- if(response)
- {
- new iznos, string[100];
- if(strfind(inputtext, "%", true) != -1) return SendClientMessage(playerid, -1, "Samo brojeve koristi");
- if(sscanf(inputtext, "i", iznos)) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
- if(iznos <= 1000 || iznos >= 20001) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Posao bus vozac", "Unesi iznos plate", "Unesi", "Izlaz");
- jobPay[POSAO_BUS] = iznos;
- format(string, sizeof(string), "Plata od Bus vozaca je postavljena na %d$", iznos);
- SendClientMessageToAll(-1, string);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement