Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. YCMD:quiz(playerid, params[],help)
  2. {
  3. #pragma unused help
  4. new choice[10], subparam[64];
  5. if(sscanf(params, "s[10]S()[64]", choice, subparam)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz [create/answer/delete/end/help]");
  6.  
  7. if(!strcmp(choice, "create"))
  8. {
  9. if(PlayerInfo[playerid][pLider] == 6)
  10. {
  11. if(!quizexist)
  12. {
  13. ShowPlayerDialog(playerid, 5555, DIALOG_STYLE_INPUT, "Quiz Create [Input Question]", "Input the quiz question", "Next", "Cancel");
  14. }
  15. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Ne mozes napraviti vise od jednog kviza!");
  16. }
  17. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Samo Novinari.");
  18. }
  19. else if(!strcmp(choice, "answer"))
  20. {
  21. if(quizexist)
  22. {
  23. if(!isnull(subparam))
  24. {
  25. if(!strcmp(subparam, answer))
  26. {
  27. new string[100];
  28. format(string, sizeof(string), "QUIZINFO{FFFFFF}: Kviz odgovor je bio '{FFFF00}%s{FFFFFF}'", answer);
  29. SendClientMessageToAll(0xFFFF00AA, string);
  30. format(string, sizeof(string), "* {FFFF00}%s{FFFFFF} je pobedio u kvizu.", GetName(playerid));
  31. SendClientMessageToAll(0xFFFFFFFF, string);
  32.  
  33. switch(rewardtype)
  34. {
  35. case 1: GivePlayerWeapon(playerid, reward, 999999);
  36. case 2: g_NovacPlus(playerid, reward);
  37. }
  38. quizexist = false;
  39. format(question, 256, "None");
  40. format(answer, 256, "None");
  41. rewardtype = 0;
  42. reward = 0;
  43. }
  44. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Pogresan odgovor.");
  45. }
  46. else return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz answer [ODGOVOR]");
  47. }
  48. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Nema dostupnog kviza.");
  49. }
  50. else if(!strcmp(choice, "delete"))
  51. {
  52. if(PlayerInfo[playerid][pVlasnik] == 1 || PlayerInfo[playerid][pLider] == 6 || PlayerInfo[playerid][pSkripter] == 1)
  53. {
  54. if(quizexist)
  55. {
  56. new string[100];
  57. quizexist = false;
  58. format(question, 256, "None");
  59. format(answer, 256, "None");
  60. rewardtype = 0;
  61. reward = 0;
  62. format(string, sizeof(string), "QUIZINFO{FFFFFF}: Admin {FFFF00}%s{FFFFFF} je obrisao trenutno dostupan kviz.", GetName(playerid));
  63. SendClientMessageToAll(0xFFFF00AA, string);
  64. }
  65. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: Nema dostupnog kviza.");
  66. }
  67. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: NISI RCON Admin.");
  68. }
  69. else if(!strcmp(choice, "end"))
  70. {
  71. if(PlayerInfo[playerid][pVlasnik] == 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pSkripter] == 1)
  72. {
  73. if(quizexist)
  74. {
  75. new string[100];
  76. format(string, sizeof(string), "QUIZINFO{FFFFFF}: Admin {FFFF00}%s{FFFFFF} je zavrsio kviz.", GetName(playerid));
  77. SendClientMessageToAll(0xFFFF00AA, string);
  78. format(string, sizeof(string), "* Tacan odgovor bio je '{FFFF00}%s{FFFFFF}'", answer);
  79. SendClientMessageToAll(0xFFFFFFFF, string);
  80. quizexist = false;
  81. format(question, 256, "None");
  82. format(answer, 256, "None");
  83. rewardtype = 0;
  84. reward = 0;
  85. }
  86. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: There is no available quiz.");
  87. }
  88. else return SendClientMessage(playerid, 0xAFAFAFAA, "ERROR: You are not RCON Admin.");
  89. }
  90. else if(!strcmp(choice, "help"))
  91. {
  92. SendClientMessage(playerid, 0x33CCFFAA, "Tutorial Kviz Sistema BB!:");
  93. SendClientMessage(playerid, 0xFFFFFFFF, "Postoji komanda /quiz sa 5 stavki");
  94. SendClientMessage(playerid, 0x33CCFFAA, "/quiz create {FFFFFF}- Ova je komanda za pravljenje kviza ({FF0000}Note{FFFFFF}: RCON Admin Only)");
  95. SendClientMessage(playerid, 0x33CCFFAA, "/quiz answer {FFFFFF}- Ova je komanda za odgovor na postavljeno pitanje.");
  96. SendClientMessage(playerid, 0x33CCFFAA, "/quiz delete {FFFFFF}- Ova je komanda za brisanje postojeceg kviza. ({FF0000}Note{FFFFFF}: RCON Admin Only)");
  97. SendClientMessage(playerid, 0x33CCFFAA, "/quiz end {FFFFFF}- Ova komanda je za zavrsetak kviza. ({FF0000}Note{FFFFFF}: RCON Admin Only Only)");
  98. SendClientMessage(playerid, 0x33CCFFAA, "/quiz help {FFFFFF}- Ovu komandu upravo sad koristis,budalo!");
  99. SendClientMessage(playerid, 0xFFFFFFFF, "Ako ti treba pomoc oko kviza obrati se vlasniku.");
  100. }
  101. else return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /quiz [create/answer/delete/end/help]");
  102. return 1;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement