Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new InDialog[MAX_PAYERS], DListitem[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- InDialog[playerid] = 0;
- DListitem[playerid] = -1;
- return;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- printf("OnDialogResponse: Playerid %i, DialogID: %i, InDialog: %i, Dialog Listitem Selected: %i", playerid,dialogid, InDialog[playerid], DListitem[playerid]);
- if(dialogid == DIALOG_AUTOSKOLABG)
- {
- if(!response) return 1;
- InDialog[playerid] = 1;
- if(listitem == 0)
- {
- // Driving Licence
- SendClientMessage(playerid,-1,"Zapoceli ste polaganje Vozacke Dozvole, odgovorite tacno na pitanja!");
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE1, DIALOG_STYLE_LIST, ""BELA"Kojom stranom se vozi u saobracaju?", ""BELA"Desnom Stranom\nLijevom Stranom\nKako god hocu\n", "Odaberi", "Izlaz");
- NovacMinus(playerid,1000);
- }
- else if(listitem == 1)
- {
- // Motor Licence
- SendClientMessage(playerid,-1,"Zapoceli ste polaganje Dozvole za motor, odgovorite tacno na pitanja!");
- NovacMinus(playerid,1000);
- }
- else if(listitem == 2)
- {
- // Airplace Lic
- SendClientMessage(playerid,-1,"Zapoceli ste polaganje Dozvole za avion, lokacija za polaganje vam je oznacena na mapi!");
- NovacMinus(playerid,1000);
- }
- else if(listitem == 3)
- {
- // Boat Lic
- SendClientMessage(playerid,-1,"Kupili ste dozvolu za Brod!");
- PlayerInfo[playerid][pDozvolaBrod] = 1;
- NovacMinus(playerid,15000);
- }
- return 1;
- }
- if(dialogid == DIALOG_POLAGANJE1)
- {
- if(!response) return 1;
- if(DListitem[playerid] == -1)
- {
- DListitem[playerid] = listitem;
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("resetfreeze", 4500, false, "i", playerid, InDialog[playerid], DListitem[playerid]);
- SendClientMessage(playerid, -1, "Please wait 5 seconds, validating your answer!");
- return 1;
- }
- InDialog[playerid] = 2;
- if(listitem == 0)
- {
- SCM(playerid,-1,"Tacan odgovor!");
- /*
- When the traffic light is yellow, what are you going to do? Get out of the vehicle /
- Prepare for departure and wait for the green light/ You will only stand with the vehicle
- */
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE2, DIALOG_STYLE_LIST, ""BELA"Kada je na semaforu zuto svjetlo sta cete uraditi?", ""BELA"Izaci iz vozila\nPripremiti se za polazak i sacekati zeleno svjetlo\nSamo cete stajati sa vozilom", "Odaberi", "Izlaz");
- }
- else if(listitem == 1 || listitem == 2)
- {
- SCM(playerid,-1,"Pogresan odgovor!");
- PlayerInfo[playerid][pAutoSkolaPogresio] += 1;
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE2, DIALOG_STYLE_LIST, ""BELA"Kada je na semaforu zuto svjetlo sta cete uraditi?", ""BELA"Izaci iz vozila\nPripremiti se za polazak i sacekati zeleno svjetlo\nSamo cete stajati sa vozilom", "Odaberi", "Izlaz");
- }
- return 1;
- }
- if(dialogid == DIALOG_POLAGANJE2)
- {
- if(!response) return 1;
- if(DListitem[playerid] == -1)
- {
- DListitem[playerid] = listitem;
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("resetfreeze", 4500, false, "i", playerid, InDialog[playerid], DListitem[playerid]);
- SendClientMessage(playerid, -1, "Please wait 5 seconds, validating your answer!");
- return 1;
- }
- InDialog[playerid] = 3;
- if(listitem == 0 || listitem == 2)
- {
- //Wrong answer!
- SCM(playerid,-1,"Pogresan odgovor!");
- PlayerInfo[playerid][pAutoSkolaPogresio] += 1;
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE3, DIALOG_STYLE_LIST, ""BELA"Kada na raskrsnici dolazi vozilo sa desne strane, sta radite?", ""BELA"Propustitcu ga\nKrenucu prvi jer imam prvenstvo prolaza\nIzaci iz vozila i izlupat mu auto\n", "Odaberi", "Izlaz");
- }
- else if(listitem == 1)
- {
- // Correct Answer
- SCM(playerid,-1,"Tacan odgovor!");
- /*
- When the vehicle comes to the right at the intersection, what do you do?
- I'm going to miss him \ I'll go first because I have a pass priority \ Get out of the car and pull out his car
- */
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE3, DIALOG_STYLE_LIST, ""BELA"Kada na raskrsnici dolazi vozilo sa desne strane, sta radite?", ""BELA"Propustitcu ga\nKrenucu prvi jer imam prvenstvo prolaza\nIzaci iz vozila i izlupat mu auto\n", "Odaberi", "Izlaz");
- }
- return 1;
- }
- if(dialogid == DIALOG_POLAGANJE3)
- {
- if(!response) return 1;
- if(DListitem[playerid] == -1)
- {
- DListitem[playerid] = listitem;
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("resetfreeze", 4500, false, "i", playerid, InDialog[playerid], DListitem[playerid]);
- SendClientMessage(playerid, -1, "Please wait 5 seconds, validating your answer!");
- return 1;
- }
- InDialog[playerid] = 4;
- if(listitem == 0)
- {
- SCM(playerid,-1,"Tacan odgovor!");
- /* Officer regulates traffic, will you?
- You will do what you think you should \ Listen to the officer's orders \ You will not pay attention to the officer
- */
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE4, DIALOG_STYLE_LIST, ""BELA"Policajac regulise saobracaj, vi cete?", ""BELA"Uradicete kako vi mislite da treba\nPoslusati Naredbe poliacajca\nNecete obracati paznju na policajca", "Odaberi", "Izlaz");
- }
- else if(listitem == 1 || listitem == 2)
- {
- SCM(playerid,-1,"Pogresan odgovor!");
- PlayerInfo[playerid][pAutoSkolaPogresio] += 1;
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE4, DIALOG_STYLE_LIST, ""BELA"Policajac regulise saobracaj, vi cete?", ""BELA"Uradicete kako vi mislite da treba\nPoslusati Naredbe poliacajca\nNecete obracati paznju na policajca", "Odaberi", "Izlaz");
- }
- return 1;
- }
- if(dialogid == DIALOG_POLAGANJE4)
- {
- if(!response) return 1;
- if(DListitem[playerid] == -1)
- {
- DListitem[playerid] = listitem;
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("resetfreeze", 4500, false, "i", playerid, InDialog[playerid], DListitem[playerid]);
- SendClientMessage(playerid, -1, "Please wait 5 seconds, validating your answer!");
- return 1;
- }
- InDialog[playerid] = 5;
- if(listitem == 0 || listitem == 2)
- {
- SCM(playerid,-1,"Pogresan odgovor!");
- PlayerInfo[playerid][pAutoSkolaPogresio] += 1;
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE5, DIALOG_STYLE_LIST, ""BELA"Kada vozac i putnici moraju vezati pojas?", ""BELA"Kada vide policajca\nKada hoce\nUvijek\n", "Odaberi", "Izlaz");
- }
- else if(listitem == 1)
- {
- SCM(playerid,-1,"Tacan odgovor!");
- //When does the driver and passengers have to fasten their seatbelt?
- // When they see a cop \ When they want \ Always
- ShowPlayerDialog(playerid, DIALOG_POLAGANJE5, DIALOG_STYLE_LIST, ""BELA"Kada vozac i putnici moraju vezati pojas?", ""BELA"Kada vide policajca\nKada hoce\nUvijek\n", "Odaberi", "Izlaz");
- }
- return 1;
- }
- if(dialogid == DIALOG_POLAGANJE5)
- {
- if(!response) return 1;
- if(DListitem[playerid] == -1)
- {
- DListitem[playerid] = listitem;
- TogglePlayerControllable(playerid, 1);
- SetTimerEx("resetfreeze", 4500, false, "i", playerid, InDialog[playerid], DListitem[playerid]);
- SendClientMessage(playerid, -1, "Please wait 5 seconds, validating your answer!");
- return 1;
- }
- InDialog[playerid] = 0;
- DListitem[playerid] = -1;
- if(listitem == 0 || listitem == 1)
- {
- SCM(playerid,-1,"Pogresan odgovor!");
- PlayerInfo[playerid][pAutoSkolaPogresio] += 1;
- }
- else if(listitem == 2)
- {
- SCM(playerid,-1,"Tacan odgovor!");
- }
- ProvjerajemDozvole(playerid);
- return 1;
- }
- }
- public ProvjerajemDozvole(playerid)
- {
- if(PlayerInfo[playerid][pAutoSkolaPogresio] >= 1 || PlayerInfo[playerid][pAutoSkolaPogresio] >= 1)
- {
- new string[256];
- format(string, sizeof(string), "Cestitamo, uspjesno ste polozili vozacki ispit\nSada morate ici na poligon, poslije poligona slijedi gradska voznja!\nRezultat: 4/5 tacno odgovorenih pitanja.");
- ShowPlayerDialog(playerid,DIALOG_PROVJERATEST, DIALOG_STYLE_MSGBOX, "Best Extreme RolePlay - Server Statistika", string, "Ok", "");
- PlayerInfo[playerid][pAutoSkolaPoligon] = 1;
- PlayerInfo[playerid][pAutoSkolaPogresio] = 0;
- SCM(playerid,-1,"Ulaz za poligon je oznacen crvenim markerom na mapi!");
- SetCheckPoint(playerid, -2029.6805,-119.6247,1035.1719, 5.0);
- return 1;
- }
- if(PlayerInfo[playerid][pAutoSkolaPogresio] >= 2 || PlayerInfo[playerid][pAutoSkolaPogresio] >= 2)
- {
- new string[256];
- format(string, sizeof(string), "Cestitamo, uspjesno ste polozili vozacki ispit\nSada morate ici na poligon, poslije poligona slijedi gradska voznja!\nRezultat: 3/5 tacno odgovorenih pitanja.");
- ShowPlayerDialog(playerid,DIALOG_PROVJERATEST, DIALOG_STYLE_MSGBOX, "Best Extreme RolePlay - Server Statistika", string, "Ok", "");
- PlayerInfo[playerid][pAutoSkolaPoligon] = 1;
- PlayerInfo[playerid][pAutoSkolaPogresio] = 0;
- SCM(playerid,-1,"Ulaz za poligon je oznacen crvenim markerom na mapi!");
- SetCheckPoint(playerid, -2029.6805,-119.6247,1035.1719, 5.0);
- return 1;
- }
- if(PlayerInfo[playerid][pAutoSkolaPogresio] >= 3 || PlayerInfo[playerid][pAutoSkolaPogresio] >= 3)
- {
- new string[256];
- format(string, sizeof(string), "Pali ste vozacki ispit\nRezultat: 2/5 tacno odgovorenih.");
- ShowPlayerDialog(playerid,DIALOG_PROVJERATEST, DIALOG_STYLE_MSGBOX, "Best Extreme RolePlay - Server Statistika", string, "Ok", "");
- PlayerInfo[playerid][pAutoSkolaPogresio] = 0;
- SetCheckPoint(playerid, -2029.6805,-119.6247,1035.1719, 5.0);
- return 1;
- }
- return 1;
- }
- forward resetfreeze(playerid, dialogid, listitem);
- public resetfreeze(playerid, dialogid, listitem)
- {
- printf("ResetFreee: Playerid %i, InDialog: %i, Dialog Listitem Selected: %i", playerid, dialogid, listitem);
- if(IsPlayerConnected(playerid)) TogglePlayerControllable(playerid, 0);
- switch(dialogid)
- {
- case 1: OnDialogResponse(playerid, DIALOG_POLAGANJE1, true, listitem, "");
- case 2: OnDialogResponse(playerid, DIALOG_POLAGANJE2, true, listitem, "");
- case 3: OnDialogResponse(playerid, DIALOG_POLAGANJE3, true, listitem, "");
- case 4: OnDialogResponse(playerid, DIALOG_POLAGANJE4, true, listitem, "");
- case 5: OnDialogResponse(playerid, DIALOG_POLAGANJE5, true, listitem, "");
- }
- DListitem[playerid] = -1;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment