Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:quiz(playerid, params[],help)
- {
- #pragma unused help
- new choice[10], subparam[64];
- if(sscanf(params, "s[10]S()[64]", choice, subparam)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz [create/answer/delete/end/help]");
- if(!strcmp(choice, "create"))
- {
- if(PlayerInfo[playerid][pLider] == 6)
- {
- if(!quizexist)
- {
- ShowPlayerDialog(playerid, 5555, DIALOG_STYLE_INPUT, "Quiz Create [Input Question]", "Input the quiz question", "Next", "Cancel");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Ne mozes napraviti vise od jednog kviza!");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Samo Novinari.");
- }
- else if(!strcmp(choice, "answer"))
- {
- if(quizexist)
- {
- if(!isnull(subparam))
- {
- if(!strcmp(subparam, answer))
- {
- new string[100];
- format(string, sizeof(string), "QUIZINFO{FFFFFF}: Kviz odgovor je bio '{FFFF00}%s{FFFFFF}'", answer);
- SendClientMessageToAll(0xFFFF00AA, string);
- format(string, sizeof(string), "* {FFFF00}%s{FFFFFF} je pobedio u kvizu.", GetName(playerid));
- SendClientMessageToAll(0xFFFFFFFF, string);
- switch(rewardtype)
- {
- case 1: GivePlayerWeapon(playerid, reward, 999999);
- case 2: g_NovacPlus(playerid, reward);
- }
- quizexist = false;
- format(question, 256, "None");
- format(answer, 256, "None");
- rewardtype = 0;
- reward = 0;
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Pogresan odgovor.");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz answer [ODGOVOR]");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Nema dostupnog kviza.");
- }
- else if(!strcmp(choice, "delete"))
- {
- if(PlayerInfo[playerid][pVlasnik] == 1 || PlayerInfo[playerid][pLider] == 6 || PlayerInfo[playerid][pSkripter] == 1)
- {
- if(quizexist)
- {
- new string[100];
- quizexist = false;
- format(question, 256, "None");
- format(answer, 256, "None");
- rewardtype = 0;
- reward = 0;
- format(string, sizeof(string), "QUIZINFO{FFFFFF}: Admin {FFFF00}%s{FFFFFF} je obrisao trenutno dostupan kviz.", GetName(playerid));
- SendClientMessageToAll(0xFFFF00AA, string);
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Nema dostupnog kviza.");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: NISI RCON Admin.");
- }
- else if(!strcmp(choice, "end"))
- {
- if(PlayerInfo[playerid][pVlasnik] == 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pSkripter] == 1)
- {
- if(quizexist)
- {
- new string[100];
- format(string, sizeof(string), "QUIZINFO{FFFFFF}: Admin {FFFF00}%s{FFFFFF} je zavrsio kviz.", GetName(playerid));
- SendClientMessageToAll(0xFFFF00AA, string);
- format(string, sizeof(string), "* Tacan odgovor bio je '{FFFF00}%s{FFFFFF}'", answer);
- SendClientMessageToAll(0xFFFFFFFF, string);
- quizexist = false;
- format(question, 256, "None");
- format(answer, 256, "None");
- rewardtype = 0;
- reward = 0;
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: There is no available quiz.");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: You are not RCON Admin.");
- }
- else if(!strcmp(choice, "help"))
- {
- SendClientMessage(playerid, 0x33CCFFAA, "Tutorial Kviz Sistema BB!:");
- SendClientMessage(playerid, 0xFFFFFFFF, "Postoji komanda /quiz sa 5 stavki");
- SendClientMessage(playerid, 0x33CCFFAA, "/quiz create {FFFFFF}- Ova je komanda za pravljenje kviza ({FF0000}Note{FFFFFF}: RCON Admin Only)");
- SendClientMessage(playerid, 0x33CCFFAA, "/quiz answer {FFFFFF}- Ova je komanda za odgovor na postavljeno pitanje.");
- SendClientMessage(playerid, 0x33CCFFAA, "/quiz delete {FFFFFF}- Ova je komanda za brisanje postojeceg kviza. ({FF0000}Note{FFFFFF}: RCON Admin Only)");
- SendClientMessage(playerid, 0x33CCFFAA, "/quiz end {FFFFFF}- Ova komanda je za zavrsetak kviza. ({FF0000}Note{FFFFFF}: RCON Admin Only Only)");
- SendClientMessage(playerid, 0x33CCFFAA, "/quiz help {FFFFFF}- Ovu komandu upravo sad koristis,budalo!");
- SendClientMessage(playerid, 0xFFFFFFFF, "Ako ti treba pomoc oko kviza obrati se vlasniku.");
- }
- else return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz [create/answer/delete/end/help]");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement