Advertisement
Guest User

Untitled

a guest
Dec 27th, 2019
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. //============================= ALT CHAT =======================================
  2. new altchatonoff[MAX_PLAYERS];
  3. #define MAX_WARNS 8
  4. new Text: WarnTD;
  5. enum warnData {
  6. Text[128],
  7. Zauzet
  8. };
  9. new AdminWarns[ MAX_WARNS ][ warnData ];
  10.  
  11.  
  12. pod OnGameModeInit
  13. // ================================ ALT CHAT =================================
  14. WarnTD = TextDrawCreate(26.875000, 214.083435, "Text");
  15. TextDrawLetterSize(WarnTD, 0.187499, 0.800832);
  16. TextDrawAlignment(WarnTD, 1);
  17. TextDrawColor(WarnTD, -1);
  18. TextDrawSetShadow(WarnTD, 0);
  19. TextDrawSetOutline(WarnTD, 1);
  20. TextDrawBackgroundColor(WarnTD, 255);
  21. TextDrawFont(WarnTD, 1);
  22. TextDrawSetProportional(WarnTD, 1);
  23.  
  24.  
  25.  
  26.  
  27. OcistiWarnove();
  28. //==============================================================================
  29.  
  30.  
  31. //=========================== ALT CHAT =========================================
  32. stock OcistiWarnove() {
  33. for( new i = 0; i < MAX_WARNS; i++)
  34. {
  35. format(AdminWarns[ i ][ Text ], 128 ,"~r~(AC) ~w~Nema");
  36. AdminWarns[ i] [ Zauzet ] = 0;
  37. }
  38. }
  39.  
  40. stock OcistiWarn(id) {
  41. format(AdminWarns[ id ][ Text ], 128 ,"~r~(AC) ~w~Nema");
  42. AdminWarns[ id ] [ Zauzet ] = 0;
  43. }
  44.  
  45. stock OsvjeziWarn() {
  46. new updatewarntd[MAX_WARNS*128];
  47. strdel( updatewarntd, 0, sizeof(updatewarntd) );
  48. for( new i = 0; i < MAX_WARNS; i++)
  49. {
  50. if( AdminWarns [ i ] [ Zauzet ] == 0) { continue; }
  51. format(updatewarntd, sizeof( updatewarntd ), "%s%s~n~",updatewarntd, AdminWarns[ i ] [ Text ]);
  52. }
  53. TextDrawSetString(WarnTD, updatewarntd);
  54. }
  55.  
  56. stock SviZauzeti() {
  57. new koliko=0;
  58. for( new i = 0; i < MAX_WARNS; i++)
  59. {
  60. if( AdminWarns[ i ] [ Zauzet ] == 1)
  61. {
  62. koliko+=1;
  63. }
  64. }
  65. if(koliko == MAX_WARNS) return 1;
  66. return 0;
  67. }
  68.  
  69. stock DodajWarnRed(text[]) {
  70. if(strlen(text)>=100) { return 1; }
  71.  
  72. if(SviZauzeti()) { OcistiWarn(MAX_WARNS-1); OsvjeziWarn(); DodajWarnRed(text); return 1; }
  73. for( new i = 0; i < MAX_WARNS; i++)
  74. {
  75. if( AdminWarns[ i ] [ Zauzet ] == 0)
  76. {
  77. format(AdminWarns[ i ][ Text ], 128 , text );
  78. AdminWarns[ i ] [ Zauzet ] = 1;
  79. OsvjeziWarn();
  80. break;
  81. }
  82. }
  83. return 1;
  84. }
  85. //==============================================================================
  86.  
  87.  
  88. komande //
  89.  
  90. //=================================== ALT CHAT =================================
  91. YCMD:altchat(playerid, params[],help)
  92. {
  93. #pragma unused help
  94. #pragma unused params
  95. if(PlayerInfo[playerid][xAdmin] < 1) return Ovlascenje(playerid);
  96. if(altchatonoff[playerid] == 1)
  97. {
  98. TextDrawShowForPlayer(playerid,WarnTD);
  99. altchatonoff[playerid] = 0;
  100. SCM(playerid, -1, ""C_CRVENA"Server:"C_BELA"Upalili ste ALTERNATIVNI chat!");
  101. }
  102. else if(altchatonoff[playerid] == 0)
  103. {
  104. TextDrawHideForPlayer(playerid,WarnTD);
  105. altchatonoff[playerid] = 1;
  106. SCM(playerid, -1, ""C_CRVENA"Server:"C_BELA"Ugasili ste ALTERNATIVNI chat!");
  107. }
  108. return 1;
  109. }
  110.  
  111. YCMD:altchatcc(playerid, params[],help)
  112. {
  113. #pragma unused help
  114. #pragma unused params
  115. if(UlogovanProvera[playerid] == 0) return Error(playerid, "Prvo se prijavite pa koristite komande!");
  116. if(PlayerInfo[playerid][xAdmin] >= 1)
  117. {
  118. new string3g[256];
  119. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  120. DodajWarnRed(string3g);
  121. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  122. DodajWarnRed(string3g);
  123. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  124. DodajWarnRed(string3g);
  125. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  126. DodajWarnRed(string3g);
  127. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  128. DodajWarnRed(string3g);
  129. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  130. DodajWarnRed(string3g);
  131. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  132. DodajWarnRed(string3g);
  133. format(string3g, sizeof(string3g), "~r~(AC) - ~w~NEMA");
  134. DodajWarnRed(string3g);
  135.  
  136. new string[70];
  137. format(string,sizeof(string), ""C_CRVENA"AdmCmd: "C_BELA"%s je ocistio ALT CHAT!", Ime_Igraca(playerid));
  138. AdminPoruka(-1,string);
  139. }
  140. else
  141. {
  142. Ovlascenje(playerid);
  143. }
  144. return 1;
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement