Advertisement
Guest User

[FilterScript] Chatv 1.0

a guest
Nov 26th, 2012
1,760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.61 KB | None | 0 0
  1. /*
  2. Créditos: dimmy_scarface/ForT - NUNCA RETIRE OS CREDITOS--
  3.  
  4. Ultima vez compilado em: 26/11/2012
  5. http://forum.sa-mp.com
  6. */
  7.  
  8. #include <a_samp>
  9. #include <zcmd>
  10. #include <sscanf2>
  11. #include <DOF2>
  12.  
  13. #if defined MAX_PLAYERS
  14. #undef MAX_PLAYERS
  15. #define MAX_PLAYERS (100)
  16. #endif
  17.  
  18. #define Admin1 "dimmy_scarface"
  19. #define Admin2 "[WrS]ForT"
  20. #define Admin3 "[WrS]JadsoN_"
  21.  
  22. #define ChatInicio 2//Estilo do chat ao iniciar o FilterScript
  23. #define DIALOG_CHAT 9797
  24. //------------------------------------------------------------------------------
  25. new MaiorID = 1;
  26. //------------------------------------------------------------------------------
  27. new SomCHAT = 1;
  28. new TipoCHAT;
  29. new Text:TextOutros[8];
  30. new Text:TextLinhas[10];
  31. new strlinhas[10][128];
  32. new NicksBanidos[MAX_PLAYERS][MAX_PLAYER_NAME];
  33. enum ct{
  34. VendoCHAT,
  35. OnCHAT,
  36. EntrandoChat,
  37. AdmCHAT,
  38. ChatDesativado,
  39. Boox,
  40. Linhas,
  41. Banido,};
  42. new ChatInfo[MAX_PLAYERS][ct];
  43.  
  44. public OnFilterScriptInit()
  45. {
  46. for(new oi = 0; oi < MAX_PLAYERS;oi++)NicksBanidos[oi] = "Ninguem";
  47. CarregarBanidos();
  48. SomCHAT = 1;
  49. print(#|---------[ CHAT v1.0 - ON ]---------|);
  50. print(#|---------[ by dimmy_scarface ]---------|);
  51. //------------------------------------------------------------------------------
  52. CriarCHAT(ChatInicio);
  53. return 1;
  54. }
  55. ShowChat(playerid)
  56. {
  57. if(ChatInfo[playerid][Boox] == 1){
  58. TextDrawShowForPlayer(playerid,TextOutros[0]);TextDrawShowForPlayer(playerid,TextOutros[7]);
  59. TextDrawShowForPlayer(playerid,TextOutros[1]);TextDrawShowForPlayer(playerid,TextOutros[2]);
  60. TextDrawShowForPlayer(playerid,TextOutros[3]);TextDrawShowForPlayer(playerid,TextOutros[4]);}
  61. if(ChatInfo[playerid][Boox] > 9)TextDrawShowForPlayer(playerid,TextLinhas[0]);
  62. if(ChatInfo[playerid][Linhas] > 8)TextDrawShowForPlayer(playerid,TextLinhas[1]);
  63. if(ChatInfo[playerid][Linhas] > 7)TextDrawShowForPlayer(playerid,TextLinhas[2]);
  64. if(ChatInfo[playerid][Linhas] > 6)TextDrawShowForPlayer(playerid,TextLinhas[3]);
  65. if(ChatInfo[playerid][Linhas] > 5)TextDrawShowForPlayer(playerid,TextLinhas[4]);
  66. TextDrawShowForPlayer(playerid,TextLinhas[5]);TextDrawShowForPlayer(playerid,TextLinhas[6]);
  67. TextDrawShowForPlayer(playerid,TextLinhas[7]);TextDrawShowForPlayer(playerid,TextLinhas[8]);
  68. TextDrawShowForPlayer(playerid,TextLinhas[9]);
  69. return true;
  70. }
  71. HideChat(playerid)
  72. {
  73. TextDrawHideForPlayer(playerid,TextOutros[ 0 ]);TextDrawHideForPlayer(playerid,TextOutros[ 7 ]);
  74. TextDrawHideForPlayer(playerid,TextOutros[ 1 ]);TextDrawHideForPlayer(playerid,TextOutros[ 2 ]);
  75. TextDrawHideForPlayer(playerid,TextOutros[ 3 ]);TextDrawHideForPlayer(playerid,TextOutros[ 4 ]);
  76. TextDrawHideForPlayer(playerid,TextLinhas[ 0 ]);TextDrawHideForPlayer(playerid,TextLinhas[ 1 ]);
  77. TextDrawHideForPlayer(playerid,TextLinhas[ 2 ]);TextDrawHideForPlayer(playerid,TextLinhas[ 3 ]);
  78. TextDrawHideForPlayer(playerid,TextLinhas[ 4 ]);TextDrawHideForPlayer(playerid,TextLinhas[ 5 ]);
  79. TextDrawHideForPlayer(playerid,TextLinhas[ 6 ]);TextDrawHideForPlayer(playerid,TextLinhas[ 7 ]);
  80. TextDrawHideForPlayer(playerid,TextLinhas[ 8 ]);TextDrawHideForPlayer(playerid,TextLinhas[ 9 ]);
  81. return true;
  82. }
  83. public OnFilterScriptExit()
  84. {
  85. SalvarBanidos();
  86. print(#|---------[ CHAT v1.0 - OFF ]---------|);
  87. print(#|---------[ by dimmy_scarface ]---------|);
  88. //------------------------------------------------------------------------------
  89. TextDrawDestroy(TextOutros[0]);TextDrawDestroy(TextOutros[7]);
  90. TextDrawDestroy(TextOutros[2]);TextDrawDestroy(TextOutros[3]);
  91. TextDrawDestroy(TextOutros[4]);TextDrawDestroy(TextLinhas[0]);
  92. TextDrawDestroy(TextLinhas[1]);TextDrawDestroy(TextLinhas[2]);
  93. TextDrawDestroy(TextLinhas[3]);TextDrawDestroy(TextLinhas[4]);
  94. TextDrawDestroy(TextLinhas[5]);TextDrawDestroy(TextLinhas[6]);
  95. TextDrawDestroy(TextLinhas[7]);TextDrawDestroy(TextLinhas[8]);
  96. TextDrawDestroy(TextLinhas[9]);TextDrawDestroy(TextOutros[1]);
  97. TextDrawDestroy(TextOutros[5]);TextDrawDestroy(TextOutros[6]);
  98. //------------------------------------------------------------------------------
  99. print(#\n\n|----[ TextDraw's destruidas com sucesso ]----|\n\n);
  100. DOF2_Exit();
  101. return 1;
  102. }
  103.  
  104. public OnPlayerConnect(playerid)
  105. {
  106. ChatInfo[playerid][Banido] = 0;
  107. ChatInfo[playerid][VendoCHAT] = 0;ChatInfo[playerid][OnCHAT] = 0;
  108. ChatInfo[playerid][AdmCHAT] = 0;ChatInfo[playerid][Boox] = 1;
  109. ChatInfo[playerid][Linhas] = 10;ChatInfo[playerid][EntrandoChat] = 0;
  110. if(playerid+1 > MaiorID)MaiorID = playerid+1;ChatInfo[playerid][ChatDesativado] = 0;
  111. //------------------------------------------------------------------------------
  112. if(strcmp(getnome(playerid),Admin1,true) == 0 || strcmp(getnome(playerid),Admin2,true) == 0 ||
  113. strcmp(getnome(playerid),Admin3,true) == 0){
  114. ChatInfo[playerid][AdmCHAT] = 5;
  115. SendClientMessage(playerid, -1, #Você é administrador do CHAT.);}
  116. for(new oi = 0; oi < MAX_PLAYERS; oi++){
  117. if(strcmp(NicksBanidos[oi],getnome(playerid),true)==0){
  118. ChatInfo[playerid][Banido] = 1;
  119. SendClientMessage(playerid, 0xFF0000FF, #Você está banido do chat.);}
  120. }
  121. return 1;
  122. }
  123.  
  124. public OnPlayerDisconnect(playerid, reason)
  125. {
  126. if(MaiorID == playerid+1)CheckMaiorID(playerid);
  127. if(ChatInfo[playerid][OnCHAT] == 1){
  128. new strin[71];
  129. if(ChatInfo[playerid][AdmCHAT] > 0)format(strin, sizeof strin, "~r~(ADM) %s saiu do chat.", getnome(playerid));
  130. else format(strin, sizeof strin, "~r~%s saiu do chat.", getnome(playerid));
  131. AtualizarLinhas();strlinhas[9] = strin;
  132. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  133. for(new i=0;i<MaiorID;i++)if(IsPlayerConnected(i)&&ChatInfo[i][OnCHAT]==1)PlayerPlaySound(i,6400,0.0,0.0,0.0);}
  134. return 1;
  135. }
  136. stock CheckMaiorID(playerid)
  137. {
  138. new mrid = 1;
  139. for(new id=0;id<MAX_PLAYERS;id++){if(IsPlayerConnected(id)&&id!=playerid){mrid=id+1;}}
  140. MaiorID = mrid;
  141. return true;
  142. }
  143.  
  144. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  145. {
  146. if(newkeys == KEY_YES && ChatInfo[playerid][OnCHAT] == 1 && ChatInfo[playerid][VendoCHAT] == 1){
  147. ShowPlayerDialog(playerid,DIALOG_CHAT,DIALOG_STYLE_INPUT,"Escreva no Xat",
  148. ". .",
  149. "Enviar","cancelar");}
  150. return 1;
  151. }
  152.  
  153.  
  154. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  155. {
  156. if(dialogid == DIALOG_CHAT){
  157. if(gettime()<ChatInfo[playerid][ChatDesativado])return SendClientMessage(playerid,0xFFFFFF,"Seu chat foi desativado temporariamente.");
  158. if(!response)return true;
  159. if(!strlen(inputtext))return true;
  160. for(new lin=0;lin<strlen(inputtext);lin++){
  161. if(inputtext[lin]=='~')inputtext[lin]='#';else if(inputtext[lin]=='á')inputtext[lin]='a';
  162. else if(inputtext[lin]=='â')inputtext[lin]='™';else if(inputtext[lin]=='ã')inputtext[lin]='™';
  163. else if(inputtext[lin]=='Ã')inputtext[lin]='A';else if(inputtext[lin]=='Á')inputtext[lin]='A';
  164. else if(inputtext[lin]=='É')inputtext[lin]='E';else if(inputtext[lin]=='Ê')inputtext[lin]='E';
  165. else if(inputtext[lin]=='Ú')inputtext[lin]='U';else if(inputtext[lin]=='Ù')inputtext[lin]='U';
  166. else if(inputtext[lin]=='é')inputtext[lin]='e';else if(inputtext[lin]=='ê')inputtext[lin]='e';
  167. else if(inputtext[lin]=='è')inputtext[lin]='e';else if(inputtext[lin]=='í')inputtext[lin]='i';
  168. else if(inputtext[lin]=='ì')inputtext[lin]='i';else if(inputtext[lin]=='î')inputtext[lin]='i';
  169. else if(inputtext[lin]=='ó')inputtext[lin]='¦';else if(inputtext[lin]=='ô')inputtext[lin]='o';
  170. else if(inputtext[lin]=='õ')inputtext[lin]='o';else if(inputtext[lin]=='ò')inputtext[lin]='o';
  171. else if(inputtext[lin]=='ú')inputtext[lin]='ª';else if(inputtext[lin]=='ù')inputtext[lin]='©';
  172. else if(inputtext[lin]=='û')inputtext[lin]='«';else if(inputtext[lin]=='º')inputtext[lin]='|';
  173. else if(inputtext[lin]=='ª')inputtext[lin]='|';else if(inputtext[lin]=='à')inputtext[lin]='a';
  174. else if(inputtext[lin]=='ñ')inputtext[lin]='n';else if(inputtext[lin]=='ý')inputtext[lin]='y';
  175. else if(inputtext[lin]=='ç')inputtext[lin]='œ';else if(inputtext[lin]=='^')inputtext[lin]='<';}
  176. new
  177. strimp[115], name[MAX_PLAYER_NAME];
  178. GetPlayerName(playerid, name, sizeof name);
  179. format(strimp, sizeof strimp, "~b~~h~~h~%s: ~w~%s", name,inputtext);
  180. //------------------------------------------------------------------------------
  181. strimp [ strlen ( strimp ) ] = 'Ä';//<= evitando um BUG tenso...
  182. //------------------------------------------------------------------------------
  183. AtualizarLinhas();strlinhas[9] = strimp;
  184. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  185. }
  186. return 1;
  187. }
  188. stock AtualizarLinhas ( )
  189. {
  190. strlinhas [ 0 ] = strlinhas [ 1 ];strlinhas [ 1 ] = strlinhas [ 2 ];strlinhas [ 2 ] = strlinhas [ 3 ];
  191. strlinhas [ 3 ] = strlinhas [ 4 ];strlinhas [ 4 ] = strlinhas [ 5 ];strlinhas [ 5 ] = strlinhas [ 6 ];
  192. strlinhas [ 6 ] = strlinhas [ 7 ];strlinhas [ 7 ] = strlinhas [ 8 ];strlinhas [ 8 ] = strlinhas [ 9 ];
  193. //------------------------------------------------------------------------------
  194. TextDrawSetString ( TextLinhas [ 0 ] , strlinhas [ 0 ] ) ;
  195. TextDrawSetString ( TextLinhas [ 1 ] , strlinhas [ 1 ] ) ;
  196. TextDrawSetString ( TextLinhas [ 2 ] , strlinhas [ 2 ] ) ;
  197. TextDrawSetString ( TextLinhas [ 3 ] , strlinhas [ 3 ] ) ;
  198. TextDrawSetString ( TextLinhas [ 4 ] , strlinhas [ 4 ] ) ;
  199. TextDrawSetString ( TextLinhas [ 5 ] , strlinhas [ 5 ] ) ;
  200. TextDrawSetString ( TextLinhas [ 6 ] , strlinhas [ 6 ] ) ;
  201. TextDrawSetString ( TextLinhas [ 7 ] , strlinhas [ 7 ] ) ;
  202. TextDrawSetString ( TextLinhas [ 8 ] , strlinhas [ 8 ] ) ;
  203. //------------------------------------------------------------------------------
  204. for(new i = 0; i < MaiorID ; i++ )
  205. {
  206. if( IsPlayerConnected ( i ) && ChatInfo [ i ] [ OnCHAT ] == 1 )
  207. {
  208. if ( SomCHAT == 1 ) PlayerPlaySound ( i , 4601 , 0.0 , 0.0 , 0.0 ) ;
  209. else if ( SomCHAT == 2 ) PlayerPlaySound ( i , 1150 , 0.0 , 0.0 , 0.0 ) ;
  210. else if ( SomCHAT == 3 ) PlayerPlaySound ( i , 1100 , 0.0 , 0.0 , 0.0 ) ;
  211. else if ( SomCHAT == 4 ) PlayerPlaySound ( i , 1135 , 0.0 , 0.0 , 0.0 ) ;
  212. else if ( SomCHAT == 5 ) PlayerPlaySound ( i , 1190 , 0.0 , 0.0 , 0.0 ) ;
  213. else if ( SomCHAT == 6 ) PlayerPlaySound ( i , 1084 , 0.0 , 0.0 , 0.0 ) ;
  214. else if ( SomCHAT == 7 ) PlayerPlaySound ( i , 1085 , 0.0 , 0.0 , 0.0 ) ;
  215. else if ( SomCHAT == 8 ) PlayerPlaySound ( i , 1095 , 0.0 , 0.0 , 0.0 ) ;
  216. else if ( SomCHAT == 9 ) PlayerPlaySound ( i , 6401 , 0.0 , 0.0 , 0.0 ) ;
  217. }
  218. }
  219. return 1;
  220. }
  221. stock getnome( playerid )
  222. {
  223. new nome [ MAX_PLAYER_NAME ] ;
  224. GetPlayerName ( playerid , nome , sizeof nome ) ;
  225. return nome ;
  226. }
  227.  
  228. stock CriarCHAT(tp)
  229. {
  230. TipoCHAT = tp;
  231. if(tp == 1){
  232. TextOutros[0] = TextDrawCreate(333.000000, 131.000000, "_" );
  233. TextDrawBackgroundColor(TextOutros[0],255);
  234. TextDrawFont(TextOutros[0],1);
  235. TextDrawLetterSize(TextOutros[0],0.500000,25.200000);
  236. TextDrawColor(TextOutros[0],-1);
  237. TextDrawSetOutline(TextOutros[0],0);
  238. TextDrawSetProportional(TextOutros[0],1);
  239. TextDrawSetShadow(TextOutros[0],1);
  240. TextDrawUseBox(TextOutros[0],1);
  241. TextDrawBoxColor(TextOutros[0],60);
  242. TextDrawTextSize(TextOutros[0],638.000000, 272.000000);
  243. TextOutros[7] = TextDrawCreate(430.000000, 137.000000, "Chat v1.0");
  244. TextDrawBackgroundColor(TextOutros[7], -16777196);
  245. TextDrawFont(TextOutros[7], 2);
  246. TextDrawLetterSize(TextOutros[7], 0.459998, 1.400004);
  247. TextDrawColor(TextOutros[7], -16776961);
  248. TextDrawSetOutline(TextOutros[7], 1);
  249. TextDrawSetProportional(TextOutros[7], 1);
  250. TextLinhas[0] = TextDrawCreate(342.000000, 182.000000, " ");
  251. TextDrawBackgroundColor(TextLinhas[0], 30);
  252. TextDrawFont(TextLinhas[0], 1);
  253. TextDrawLetterSize(TextLinhas[0], 0.259999, 1.000000);
  254. TextDrawColor(TextLinhas[0], -1);
  255. TextDrawSetOutline(TextLinhas[0], 0);
  256. TextDrawSetProportional(TextLinhas[0], 1);
  257. TextDrawSetShadow(TextLinhas[0], 1);
  258. TextLinhas[1] = TextDrawCreate(342.000000, 200.000000, " ");
  259. TextDrawBackgroundColor(TextLinhas[1], 30);
  260. TextDrawFont(TextLinhas[1], 1);
  261. TextDrawLetterSize(TextLinhas[1], 0.259999, 1.000000);
  262. TextDrawColor(TextLinhas[1], -1);
  263. TextDrawSetOutline(TextLinhas[1], 0);
  264. TextDrawSetProportional(TextLinhas[1], 1);
  265. TextDrawSetShadow(TextLinhas[1], 1);
  266. TextLinhas[2] = TextDrawCreate(342.000000, 217.000000, " ");
  267. TextDrawBackgroundColor(TextLinhas[2], 30);
  268. TextDrawFont(TextLinhas[2], 1);
  269. TextDrawLetterSize(TextLinhas[2], 0.259999, 1.000000);
  270. TextDrawColor(TextLinhas[2], -1);
  271. TextDrawSetOutline(TextLinhas[2], 0);
  272. TextDrawSetProportional(TextLinhas[2], 1);
  273. TextDrawSetShadow(TextLinhas[2], 1);
  274. TextLinhas[3] = TextDrawCreate(342.000000, 234.000000, " ");
  275. TextDrawBackgroundColor(TextLinhas[3], 30);
  276. TextDrawFont(TextLinhas[3], 1);
  277. TextDrawLetterSize(TextLinhas[3], 0.259999, 1.000000);
  278. TextDrawColor(TextLinhas[3], -1);
  279. TextDrawSetOutline(TextLinhas[3], 0);
  280. TextDrawSetProportional(TextLinhas[3], 1);
  281. TextDrawSetShadow(TextLinhas[3], 1);
  282. TextLinhas[4] = TextDrawCreate(342.000000, 251.000000, " ");
  283. TextDrawBackgroundColor(TextLinhas[4], 30);
  284. TextDrawFont(TextLinhas[4], 1);
  285. TextDrawLetterSize(TextLinhas[4], 0.259999, 1.000000);
  286. TextDrawColor(TextLinhas[4], -1);
  287. TextDrawSetOutline(TextLinhas[4], 0);
  288. TextDrawSetProportional(TextLinhas[4], 1);
  289. TextDrawSetShadow(TextLinhas[4], 1);
  290. TextLinhas[5] = TextDrawCreate(342.000000, 268.000000, " ");
  291. TextDrawBackgroundColor(TextLinhas[5], 30);
  292. TextDrawFont(TextLinhas[5], 1);
  293. TextDrawLetterSize(TextLinhas[5], 0.259999, 1.000000);
  294. TextDrawColor(TextLinhas[5], -1);
  295. TextDrawSetOutline(TextLinhas[5], 0);
  296. TextDrawSetProportional(TextLinhas[5], 1);
  297. TextDrawSetShadow(TextLinhas[5], 1);
  298. TextLinhas[6] = TextDrawCreate(342.000000, 285.000000, " ");
  299. TextDrawBackgroundColor(TextLinhas[6], 30);
  300. TextDrawFont(TextLinhas[6], 1);
  301. TextDrawLetterSize(TextLinhas[6], 0.259999, 1.000000);
  302. TextDrawColor(TextLinhas[6], -1);
  303. TextDrawSetOutline(TextLinhas[6], 0);
  304. TextDrawSetProportional(TextLinhas[6], 1);
  305. TextDrawSetShadow(TextLinhas[6], 1);
  306. TextLinhas[7] = TextDrawCreate(342.000000, 301.000000, " ");
  307. TextDrawBackgroundColor(TextLinhas[7], 30);
  308. TextDrawFont(TextLinhas[7], 1);
  309. TextDrawLetterSize(TextLinhas[7], 0.259999, 1.000000);
  310. TextDrawColor(TextLinhas[7], -1);
  311. TextDrawSetOutline(TextLinhas[7], 0);
  312. TextDrawSetProportional(TextLinhas[7], 1);
  313. TextDrawSetShadow(TextLinhas[7], 1);
  314. TextLinhas[8] = TextDrawCreate(342.000000, 317.000000, " ");
  315. TextDrawBackgroundColor(TextLinhas[8], 30);
  316. TextDrawFont(TextLinhas[8], 1);
  317. TextDrawLetterSize(TextLinhas[8], 0.259999, 1.000000);
  318. TextDrawColor(TextLinhas[8], -1);
  319. TextDrawSetOutline(TextLinhas[8], 0);
  320. TextDrawSetProportional(TextLinhas[8], 1);
  321. TextDrawSetShadow(TextLinhas[8], 1);
  322. TextLinhas[9] = TextDrawCreate(342.000000, 333.000000, " ");
  323. TextDrawBackgroundColor(TextLinhas[9], 30);
  324. TextDrawFont(TextLinhas[9], 1);
  325. TextDrawLetterSize(TextLinhas[9], 0.259999, 1.000000);
  326. TextDrawColor(TextLinhas[9], -1);
  327. TextDrawSetOutline(TextLinhas[9], 0);
  328. TextDrawSetProportional(TextLinhas[9], 1);
  329. TextDrawSetShadow(TextLinhas[9], 1);
  330. TextOutros[1] = TextDrawCreate(421.000000, 150.000000, "ld_dual:health");
  331. TextDrawBackgroundColor(TextOutros[1], 255);
  332. TextDrawFont(TextOutros[1], 4);
  333. TextDrawLetterSize(TextOutros[1], 0.500000, 1.000000);
  334. TextDrawColor(TextOutros[1], -1);
  335. TextDrawSetOutline(TextOutros[1], 0);
  336. TextDrawSetProportional(TextOutros[1], 1);
  337. TextDrawSetShadow(TextOutros[1], 1);
  338. TextDrawUseBox(TextOutros[1], 1);
  339. TextDrawBoxColor(TextOutros[1], 255);
  340. TextDrawTextSize(TextOutros[1], 110.000000, 1.000000);
  341. TextOutros[2] = TextDrawCreate(329.000000, 127.000000, "ld_dual:health");
  342. TextDrawBackgroundColor(TextOutros[2], 255);
  343. TextDrawFont(TextOutros[2], 4);
  344. TextDrawLetterSize(TextOutros[2], 0.500000, 1.000000);
  345. TextDrawColor(TextOutros[2], -1);
  346. TextDrawSetOutline(TextOutros[2], 0);
  347. TextDrawSetProportional(TextOutros[2], 1);
  348. TextDrawSetShadow(TextOutros[2], 1);
  349. TextDrawUseBox(TextOutros[2], 1);
  350. TextDrawBoxColor(TextOutros[2], 255);
  351. TextDrawTextSize(TextOutros[2], 2.000000, 235.000000);
  352. TextOutros[3] = TextDrawCreate(331.000000, 127.000000, "ld_dual:health");
  353. TextDrawBackgroundColor(TextOutros[3], 255);
  354. TextDrawFont(TextOutros[3], 4);
  355. TextDrawLetterSize(TextOutros[3], 0.500000, 1.000000);
  356. TextDrawColor(TextOutros[3], -1);
  357. TextDrawSetOutline(TextOutros[3], 0);
  358. TextDrawSetProportional(TextOutros[3], 1);
  359. TextDrawSetShadow(TextOutros[3], 1);
  360. TextDrawUseBox(TextOutros[3], 1);
  361. TextDrawBoxColor(TextOutros[3], 255);
  362. TextDrawTextSize(TextOutros[3], 338.000000, 2.000000);
  363. TextOutros[4] = TextDrawCreate(331.000000, 360.000000, "ld_dual:health");
  364. TextDrawBackgroundColor(TextOutros[4], 255);
  365. TextDrawFont(TextOutros[4], 4);
  366. TextDrawLetterSize(TextOutros[4], 0.500000, 1.000000);
  367. TextDrawColor(TextOutros[4], -1);
  368. TextDrawSetOutline(TextOutros[4], 0);
  369. TextDrawSetProportional(TextOutros[4], 1);
  370. TextDrawSetShadow(TextOutros[4], 1);
  371. TextDrawUseBox(TextOutros[4], 1);
  372. TextDrawBoxColor(TextOutros[4], 255);
  373. TextDrawTextSize(TextOutros[4], 322.000000, 2.000000);
  374. TextOutros[5] = TextDrawCreate(421.000000, 241.000000, "Entrando...");
  375. TextDrawBackgroundColor(TextOutros[5], 50);
  376. TextDrawFont(TextOutros[5], 2);
  377. TextDrawLetterSize(TextOutros[5], 0.519999, 1.399999);
  378. TextDrawColor(TextOutros[5], -16776961);
  379. TextDrawSetOutline(TextOutros[5], 1);
  380. TextDrawSetProportional(TextOutros[5], 1);}
  381. else if(tp == 2){
  382. TextOutros[0] = TextDrawCreate(672.000000, 289.000000, "_");
  383. TextDrawBackgroundColor(TextOutros[0], 10);
  384. TextDrawFont(TextOutros[0], 1);
  385. TextDrawLetterSize(TextOutros[0], 0.500000, 14.799999);
  386. TextDrawColor(TextOutros[0], -1);
  387. TextDrawSetOutline(TextOutros[0], 0);
  388. TextDrawSetProportional(TextOutros[0], 1);
  389. TextDrawSetShadow(TextOutros[0], 1);
  390. TextDrawUseBox(TextOutros[0], 1);
  391. TextDrawBoxColor(TextOutros[0], 80);
  392. TextDrawTextSize(TextOutros[0], 167.000000, -1.000000);
  393. TextOutros[7] = TextDrawCreate(169.000000, 286.000000, "ld_dual:health");
  394. TextDrawBackgroundColor(TextOutros[7], 255);
  395. TextDrawFont(TextOutros[7], 4);
  396. TextDrawLetterSize(TextOutros[7], 0.500000, 1.000000);
  397. TextDrawColor(TextOutros[7], -1);
  398. TextDrawSetOutline(TextOutros[7], 0);
  399. TextDrawSetProportional(TextOutros[7], 1);
  400. TextDrawSetShadow(TextOutros[7], 1);
  401. TextDrawUseBox(TextOutros[7], 1);
  402. TextDrawBoxColor(TextOutros[7], 255);
  403. TextDrawTextSize(TextOutros[7], 481.000000, 2.000000);
  404. TextLinhas[0] = TextDrawCreate(178.000000, 291.000000, " ");
  405. TextDrawBackgroundColor(TextLinhas[0], 15);
  406. TextDrawFont(TextLinhas[0], 1);
  407. TextDrawLetterSize(TextLinhas[0], 0.280000, 1.100000);
  408. TextDrawColor(TextLinhas[0], -1);
  409. TextDrawSetOutline(TextLinhas[0], 0);
  410. TextDrawSetProportional(TextLinhas[0], 1);
  411. TextDrawSetShadow(TextLinhas[0], 1);
  412. TextLinhas[1] = TextDrawCreate(178.000000, 304.000000, " ");
  413. TextDrawBackgroundColor(TextLinhas[1], 20);
  414. TextDrawFont(TextLinhas[1], 1);
  415. TextDrawLetterSize(TextLinhas[1], 0.280000, 1.100000);
  416. TextDrawColor(TextLinhas[1], -1);
  417. TextDrawSetOutline(TextLinhas[1], 0);
  418. TextDrawSetProportional(TextLinhas[1], 1);
  419. TextDrawSetShadow(TextLinhas[1], 1);
  420. TextLinhas[2] = TextDrawCreate(178.000000, 317.000000, " ");
  421. TextDrawBackgroundColor(TextLinhas[2], 20);
  422. TextDrawFont(TextLinhas[2], 1);
  423. TextDrawLetterSize(TextLinhas[2], 0.280000, 1.100000);
  424. TextDrawColor(TextLinhas[2], -1);
  425. TextDrawSetOutline(TextLinhas[2], 0);
  426. TextDrawSetProportional(TextLinhas[2], 1);
  427. TextDrawSetShadow(TextLinhas[2], 1);
  428. TextLinhas[3] = TextDrawCreate(178.000000, 330.000000, " ");
  429. TextDrawBackgroundColor(TextLinhas[3], 20);
  430. TextDrawFont(TextLinhas[3], 1);
  431. TextDrawLetterSize(TextLinhas[3], 0.280000, 1.100000);
  432. TextDrawColor(TextLinhas[3], -1);
  433. TextDrawSetOutline(TextLinhas[3], 0);
  434. TextDrawSetProportional(TextLinhas[3], 1);
  435. TextDrawSetShadow(TextLinhas[3], 1);
  436. TextLinhas[4] = TextDrawCreate(178.000000, 343.000000, " ");
  437. TextDrawBackgroundColor(TextLinhas[4], 20);
  438. TextDrawFont(TextLinhas[4], 1);
  439. TextDrawLetterSize(TextLinhas[4], 0.280000, 1.100000);
  440. TextDrawColor(TextLinhas[4], -1);
  441. TextDrawSetOutline(TextLinhas[4], 0);
  442. TextDrawSetProportional(TextLinhas[4], 1);
  443. TextDrawSetShadow(TextLinhas[4], 1);
  444. TextLinhas[5] = TextDrawCreate(178.000000, 356.000000, " ");
  445. TextDrawBackgroundColor(TextLinhas[5], 20);
  446. TextDrawFont(TextLinhas[5], 1);
  447. TextDrawLetterSize(TextLinhas[5], 0.280000, 1.100000);
  448. TextDrawColor(TextLinhas[5], -1);
  449. TextDrawSetOutline(TextLinhas[5], 0);
  450. TextDrawSetProportional(TextLinhas[5], 1);
  451. TextDrawSetShadow(TextLinhas[5], 1);
  452. TextLinhas[6] = TextDrawCreate(178.000000, 369.000000, " ");
  453. TextDrawBackgroundColor(TextLinhas[6], 20);
  454. TextDrawFont(TextLinhas[6], 1);
  455. TextDrawLetterSize(TextLinhas[6], 0.280000, 1.100000);
  456. TextDrawColor(TextLinhas[6], -1);
  457. TextDrawSetOutline(TextLinhas[6], 0);
  458. TextDrawSetProportional(TextLinhas[6], 1);
  459. TextDrawSetShadow(TextLinhas[6], 1);
  460. TextLinhas[7] = TextDrawCreate(178.000000, 382.000000, " ");
  461. TextDrawBackgroundColor(TextLinhas[7], 20);
  462. TextDrawFont(TextLinhas[7], 1);
  463. TextDrawLetterSize(TextLinhas[7], 0.280000, 1.100000);
  464. TextDrawColor(TextLinhas[7], -1);
  465. TextDrawSetOutline(TextLinhas[7], 0);
  466. TextDrawSetProportional(TextLinhas[7], 1);
  467. TextDrawSetShadow(TextLinhas[7], 1);
  468. TextLinhas[8] = TextDrawCreate(178.000000, 395.000000, " ");
  469. TextDrawBackgroundColor(TextLinhas[8], 20);
  470. TextDrawFont(TextLinhas[8], 1);
  471. TextDrawLetterSize(TextLinhas[8], 0.280000, 1.100000);
  472. TextDrawColor(TextLinhas[8], -1);
  473. TextDrawSetOutline(TextLinhas[8], 0);
  474. TextDrawSetProportional(TextLinhas[8], 1);
  475. TextDrawSetShadow(TextLinhas[8], 1);
  476. TextLinhas[9] = TextDrawCreate(178.000000, 408.000000, " ");
  477. TextDrawBackgroundColor(TextLinhas[9], 20);
  478. TextDrawFont(TextLinhas[9], 1);
  479. TextDrawLetterSize(TextLinhas[9], 0.280000, 1.100000);
  480. TextDrawColor(TextLinhas[9], -1);
  481. TextDrawSetOutline(TextLinhas[9], 0);
  482. TextDrawSetProportional(TextLinhas[9], 1);
  483. TextDrawSetShadow(TextLinhas[9], 1);
  484. TextOutros[1] = TextDrawCreate(170.000000, 424.000000, "ld_dual:health");
  485. TextDrawBackgroundColor(TextOutros[1], 255);
  486. TextDrawFont(TextOutros[1], 4);
  487. TextDrawLetterSize(TextOutros[1], 0.500000, 1.000000);
  488. TextDrawColor(TextOutros[1], -1);
  489. TextDrawSetOutline(TextOutros[1], 0);
  490. TextDrawSetProportional(TextOutros[1], 1);
  491. TextDrawSetShadow(TextOutros[1], 1);
  492. TextDrawUseBox(TextOutros[1], 1);
  493. TextDrawBoxColor(TextOutros[1], 255);
  494. TextDrawTextSize(TextOutros[1], 481.000000, 2.000000);
  495. TextOutros[2] = TextDrawCreate(369.000000, 278.000000, "ld_dual:health");
  496. TextDrawBackgroundColor(TextOutros[2], 255);
  497. TextDrawFont(TextOutros[2], 4);
  498. TextDrawLetterSize(TextOutros[2], 0.500000, 1.000000);
  499. TextDrawColor(TextOutros[2], -1);
  500. TextDrawSetOutline(TextOutros[2], 0);
  501. TextDrawSetProportional(TextOutros[2], 1);
  502. TextDrawSetShadow(TextOutros[2], 1);
  503. TextDrawUseBox(TextOutros[2], 1);
  504. TextDrawBoxColor(TextOutros[2], 255);
  505. TextDrawTextSize(TextOutros[2], 57.000000, 10.000000);
  506. TextOutros[3] = TextDrawCreate(381.000000, 278.000000, "chat");
  507. TextDrawBackgroundColor(TextOutros[3], -236);
  508. TextDrawFont(TextOutros[3], 1);
  509. TextDrawLetterSize(TextOutros[3], 0.500000, 1.000000);
  510. TextDrawColor(TextOutros[3], 255);
  511. TextDrawSetOutline(TextOutros[3], 1);
  512. TextDrawSetProportional(TextOutros[3], 1);
  513. TextOutros[4] = TextDrawCreate(169.000000, 288.000000, "ld_dual:health");
  514. TextDrawBackgroundColor(TextOutros[4], 255);
  515. TextDrawFont(TextOutros[4], 4);
  516. TextDrawLetterSize(TextOutros[4], 0.500000, 1.000000);
  517. TextDrawColor(TextOutros[4], -1);
  518. TextDrawSetOutline(TextOutros[4], 0);
  519. TextDrawSetProportional(TextOutros[4], 1);
  520. TextDrawSetShadow(TextOutros[4], 1);
  521. TextDrawUseBox(TextOutros[4], 1);
  522. TextDrawBoxColor(TextOutros[4], 255);
  523. TextDrawTextSize(TextOutros[4], 3.000000, 137.000000);
  524. TextOutros[5] = TextDrawCreate(338.000000, 350.000000, "Entrando...");
  525. TextDrawBackgroundColor(TextOutros[5], 50);
  526. TextDrawFont(TextOutros[5], 2);
  527. TextDrawLetterSize(TextOutros[5], 0.569999, 1.300000);
  528. TextDrawColor(TextOutros[5], -16776961);
  529. TextDrawSetOutline(TextOutros[5], 1);
  530. TextDrawSetProportional(TextOutros[5], 1);
  531. TextOutros[6] = TextDrawCreate(180.000000, 320.000000, "/mensagemchat");
  532. TextDrawBackgroundColor(TextOutros[6], -16777176);
  533. TextDrawFont(TextOutros[6], 1);
  534. TextDrawLetterSize(TextOutros[6], 0.770000, 4.599999);
  535. TextDrawColor(TextOutros[6], -16776961);
  536. TextDrawSetOutline(TextOutros[6], 1);
  537. TextDrawSetProportional(TextOutros[6], 1);}
  538. print(#\n\n|-----[ TextDraw's criadas com sucesso ]------|\n\n);
  539. return true;
  540. }
  541.  
  542. forward DTD();public DTD()TextDrawHideForAll(TextOutros[6]);
  543. new stringe[128];
  544. forward LogandoChat(playerid);
  545. public LogandoChat(playerid)
  546. {
  547. TextDrawHideForPlayer(playerid,TextOutros[0]);TextDrawHideForPlayer(playerid,TextOutros[7]);
  548. TextDrawHideForPlayer(playerid,TextOutros[2]);TextDrawHideForPlayer(playerid,TextOutros[1]);
  549. TextDrawHideForPlayer(playerid,TextOutros[3]);TextDrawHideForPlayer(playerid,TextOutros[4]);
  550. TextDrawHideForPlayer(playerid,TextOutros[5]);
  551. if(ChatInfo[playerid][AdmCHAT] > 0)format(stringe, sizeof stringe, "~r~(ADM) %s entrou no chat.", getnome(playerid));
  552. else format(stringe, sizeof stringe, "~r~%s entrou no chat.", getnome(playerid));
  553. AtualizarLinhas();strlinhas[9] = stringe;
  554. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  555. ShowChat(playerid);ChatInfo[playerid][OnCHAT] = 1;ChatInfo[playerid][VendoCHAT] = 1;ChatInfo[playerid][EntrandoChat] = 0;
  556. for(new i = 0; i < MaiorID; i++)if(IsPlayerConnected(i)&&ChatInfo[i][OnCHAT]==1)PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0);
  557. return true;
  558. }
  559. stock SalvarBanidos()
  560. {
  561. new ss[74];
  562. format(stringe,sizeof stringe,"BanidosChat.ini");
  563. if(!DOF2_FileExists(stringe))DOF2_CreateFile(stringe);
  564. for(new playerid=0;playerid<MAX_PLAYERS;playerid++){
  565. format(ss,sizeof ss,"player%d",playerid);
  566. DOF2_SetString(stringe, ss,NicksBanidos[playerid]);}
  567. return true;
  568. }
  569. stock CarregarBanidos()
  570. {
  571. new ss[74];
  572. format(stringe,sizeof stringe,"BanidosChat.ini");
  573. if(DOF2_FileExists(stringe)){
  574. for(new playerid=0;playerid<MAX_PLAYERS;playerid++){
  575. format(ss,sizeof ss,"player%d",playerid);
  576. strmid(NicksBanidos[playerid], DOF2_GetString(stringe, ss), 0, strlen(DOF2_GetString(stringe, ss)), 255);}
  577. }
  578. return true;
  579. }
  580. //----------- comandos -------------//
  581. CMD:ct(playerid, params[])
  582. {
  583. new chaty[111];
  584. if(sscanf(params, "s[111]", chaty))return SendClientMessage(playerid, -1, #=> /ct [chat]);
  585. if(ChatInfo[playerid][OnCHAT] == 1 && ChatInfo[playerid][VendoCHAT] == 1){
  586. if(gettime()<ChatInfo[playerid][ChatDesativado])return SendClientMessage(playerid,0xFFFFFF,"Seu chat foi desativado temporariamente.");
  587. for(new lin=0;lin<strlen(chaty);lin++){
  588. if(chaty[lin]=='~')chaty[lin]='#';else if(chaty[lin]=='á')chaty[lin]='a';
  589. else if(chaty[lin]=='â')chaty[lin]='a';else if(chaty[lin]=='ã')chaty[lin]='a';
  590. else if(chaty[lin]=='é')chaty[lin]='e';else if(chaty[lin]=='ê')chaty[lin]='e';
  591. else if(chaty[lin]=='è')chaty[lin]='e';else if(chaty[lin]=='í')chaty[lin]='i';
  592. else if(chaty[lin]=='ì')chaty[lin]='i';else if(chaty[lin]=='î')chaty[lin]='i';
  593. else if(chaty[lin]=='ó')chaty[lin]='¦';else if(chaty[lin]=='ô')chaty[lin]='o';
  594. else if(chaty[lin]=='õ')chaty[lin]='o';else if(chaty[lin]=='ò')chaty[lin]='o';
  595. else if(chaty[lin]=='ú')chaty[lin]='ª';else if(chaty[lin]=='ù')chaty[lin]='©';
  596. else if(chaty[lin]=='û')chaty[lin]='«';else if(chaty[lin]=='º')chaty[lin]='|';
  597. else if(chaty[lin]=='ª')chaty[lin]='|';
  598. else if(chaty[lin]=='ñ')chaty[lin]='n';else if(chaty[lin]=='ý')chaty[lin]='y';
  599. else if(chaty[lin]=='ç')chaty[lin]='c';else if(chaty[lin]=='^')chaty[lin]=':';}
  600. new
  601. strimp[115], name[MAX_PLAYER_NAME];
  602. GetPlayerName(playerid, name, sizeof name);
  603. format(strimp, sizeof strimp, "~b~~h~~h~%s: ~w~%s", name,chaty);
  604. //------------------------------------------------------------------------------
  605. strimp [ strlen ( strimp ) ] = 'Ä';//<= evitando um BUG tenso...
  606. //------------------------------------------------------------------------------
  607. AtualizarLinhas();strlinhas[9] = strimp;
  608. TextDrawSetString(TextLinhas[9], strlinhas[9]);}
  609. else return SendClientMessage(playerid, 0xFFFFFF, #Você já está logado no chat ou não está vendo o mesmo);
  610. return true;
  611. }
  612. CMD:logarchat(playerid)
  613. {
  614. if(ChatInfo[playerid][Banido] == 1)return SendClientMessage(playerid, 0xFF0000, "Você não pode entrar no chat, pois está banido");
  615. if(ChatInfo[playerid][OnCHAT] == 0){
  616. if(ChatInfo[playerid][EntrandoChat] == 1)return SendClientMessage(playerid, -1, #Você já está entrando no chat..);
  617. SetTimerEx("LogandoChat", 8000, 0, "i", playerid);
  618. TextDrawShowForPlayer(playerid,TextOutros[0]);TextDrawShowForPlayer(playerid,TextOutros[7]);
  619. TextDrawShowForPlayer(playerid,TextOutros[2]);TextDrawShowForPlayer(playerid,TextOutros[1]);
  620. TextDrawShowForPlayer(playerid,TextOutros[3]);TextDrawShowForPlayer(playerid,TextOutros[4]);
  621. TextDrawShowForPlayer(playerid,TextOutros[5]);ChatInfo[playerid][EntrandoChat] = 1;}
  622. else return SendClientMessage(playerid, 0xFFFFFF, #Você já está logado no chat);
  623. return true;
  624. }
  625. CMD:sairchat(playerid)
  626. {
  627. if(ChatInfo[playerid][OnCHAT] == 1){
  628. if(ChatInfo[playerid][AdmCHAT] > 0)format(stringe, sizeof stringe, "~r~(ADM) %s saiu do chat.", getnome(playerid));
  629. else format(stringe, sizeof stringe, "~r~%s saiu do chat.", getnome(playerid));
  630. AtualizarLinhas();strlinhas[9] = stringe;
  631. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  632. HideChat(playerid);ChatInfo[playerid][OnCHAT] = 0;ChatInfo[playerid][VendoCHAT] = 0;
  633. PlayerPlaySound(playerid, 6400, 0.0, 0.0, 0.0);
  634. for(new i = 0; i < MaiorID; i++)if(IsPlayerConnected(i) && ChatInfo[i][OnCHAT] == 1)PlayerPlaySound(i, 6400, 0.0, 0.0, 0.0);}
  635. else return SendClientMessage(playerid, 0xFFFFFF, #Você não está logado no chat);
  636. return true;
  637. }
  638. CMD:daradmchat(playerid, params[])
  639. {
  640. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 1){
  641. new id, nivel;
  642. if(sscanf(params, "ud", id, nivel))return SendClientMessage(playerid, -1, #=> /daradmchat [id][nivel]);
  643. if(!IsPlayerConnected(id))return true;
  644. format(stringe, sizeof stringe, "O ADM %s te deu Admin nivel %d do CHAT.", getnome(playerid), nivel);
  645. SendClientMessage(id, -1, stringe);
  646. format(stringe, sizeof stringe, "Voce deu admin nivel %d do CHAT para %s", nivel,getnome(id));
  647. SendClientMessage(playerid, -1, stringe);ChatInfo[id][AdmCHAT] = nivel;}
  648. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  649. return true;
  650. }
  651. CMD:mensagemchat(playerid, params[])
  652. {
  653. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 1){
  654. new msg[64];
  655. if(sscanf(params, "s[64]", msg))return SendClientMessage(playerid, -1, #=> /mensagemchat [mensagem]);
  656. if(TipoCHAT == 1)return SendClientMessage(playerid, -1, #Apenas no chat 2);
  657. TextDrawSetString(TextOutros[6], msg);
  658. for(new id=0;id<MaiorID;id++)if(ChatInfo[id][VendoCHAT]==1&&ChatInfo[id][OnCHAT]==1)TextDrawShowForPlayer(id, TextOutros[6]);
  659. SetTimer("DTD", 3000, 0);}
  660. else return SendClientMessage(playerid, -1, #Você não é um admin.);
  661. return true;
  662. }
  663. CMD:kickchat(playerid, params[])
  664. {
  665. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 0){
  666. new id, motivo[64];
  667. if(sscanf(params, "us[64]", id, motivo))return SendClientMessage(playerid, -1, #=> /kickchat [id][motivo]);
  668. if(!IsPlayerConnected(id))return true;
  669. format(stringe, sizeof stringe, "O ADM %s kickou você do CHAT, motivo: %s", getnome(playerid), motivo);
  670. SendClientMessage(id, -1, stringe);
  671. format(stringe, sizeof stringe, "~g~~h~%s kickou %s, motivo: %s", getnome(playerid),getnome(id), motivo);
  672. AtualizarLinhas();strlinhas[9] = stringe;
  673. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  674. HideChat(id);ChatInfo[id][OnCHAT] = 0;ChatInfo[id][VendoCHAT] = 0;}
  675. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  676. return true;
  677. }
  678. CMD:desativarchat(playerid, params[])
  679. {
  680. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 1){
  681. new id, minu;
  682. if(sscanf(params, "ud", id, minu))return SendClientMessage(playerid, -1, #=> /desativarchat [id][minutos]);
  683. if(!IsPlayerConnected(id))return true;
  684. format(stringe, sizeof stringe, "O ADM %s desativou seu CHAT por %d minutos.", getnome(playerid), minu);
  685. SendClientMessage(id, -1, stringe);
  686. format(stringe, sizeof stringe, "~g~~h~%s desativou o chat de %s: %d min.", getnome(playerid),getnome(id), minu);
  687. AtualizarLinhas();strlinhas[9] = stringe;
  688. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  689. ChatInfo[id][ChatDesativado] = gettime()+minu*60;}
  690. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  691. return true;
  692. }
  693. CMD:chat(playerid, params[])
  694. {
  695. new onoff[10];
  696. if(sscanf(params, "s[10]",onoff))return SendClientMessage(playerid, -1, #=> /chat ON ou /chat OFF);
  697. if(strcmp(onoff, "ON", true) == 0){
  698. if(ChatInfo[playerid][VendoCHAT] == 1)return true;
  699. PlayerPlaySound(playerid, 6402, 0.0, 0.0, 0.0);
  700. ShowChat(playerid);ChatInfo[playerid][VendoCHAT] = 1;}
  701. else if(strcmp(onoff, "OFF", true) == 0){
  702. if(ChatInfo[playerid][VendoCHAT] == 0)return true;
  703. PlayerPlaySound(playerid, 6402, 0.0, 0.0, 0.0);
  704. HideChat(playerid);ChatInfo[playerid][VendoCHAT] = 0;}
  705. else return SendClientMessage(playerid, -1, #=> /chat ON ou /chat OFF);
  706. return true;
  707. }
  708. CMD:chatsom(playerid, params[])
  709. {
  710. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 0){
  711. if(ChatInfo[playerid][OnCHAT] == 0)return SendClientMessage(playerid, 0xFFFFFF, #Você não está logado no chat);
  712. new sound;
  713. if(sscanf(params, "d",sound))return SendClientMessage(playerid, -1, #/chatsom [1 - 9]);
  714. if(sound < 1 || sound > 9)return SendClientMessage(playerid, -1, #/chatsom [1 - 9]);
  715. SomCHAT = sound;
  716. format(stringe, sizeof stringe, "~y~(ADM) %s mudou o som do chat para %d", getnome(playerid), sound);
  717. AtualizarLinhas();strlinhas[9] = stringe;
  718. TextDrawSetString(TextLinhas[9], strlinhas[9]);}
  719. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  720. return true;
  721. }
  722. CMD:box(playerid, params[])
  723. {
  724. new onoff[10];
  725. if(sscanf(params, "s[10]",onoff))return SendClientMessage(playerid, -1, #=> /box ON ou /box OFF);
  726. if(strcmp(onoff, "ON", true) == 0){
  727. if(ChatInfo[playerid][Boox] == 0 && ChatInfo[playerid][VendoCHAT] == 1){
  728. ChatInfo[playerid][Boox] = 1;
  729. HideChat(playerid);ShowChat(playerid);}}
  730. else if(strcmp(onoff, "OFF", true) == 0){
  731. if(ChatInfo[playerid][VendoCHAT] == 1 && ChatInfo[playerid][Boox] == 1){
  732. ChatInfo[playerid][Boox] = 0;
  733. HideChat(playerid);ShowChat(playerid);}}
  734. else return SendClientMessage(playerid, -1, #=> /box ON ou /box OFF);
  735. return true;
  736. }
  737. CMD:linhaschat(playerid, params[])
  738. {
  739. new linha;
  740. if(sscanf(params, "d", linha))return SendClientMessage(playerid, -1, "=> /linhaschat [5 - 10]");
  741. if(linha < 5 || linha > 10)return SendClientMessage(playerid, -1, "=> /linhaschat [5 - 10]");
  742. if(ChatInfo[playerid][VendoCHAT] == 0)return true;
  743. ChatInfo[playerid][Linhas] = linha;HideChat(playerid);ShowChat(playerid);
  744. return true;
  745. }
  746. CMD:mudarchat(playerid, params[])
  747. {
  748. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 1){
  749. new tipo;
  750. if(sscanf(params, "d", tipo))return SendClientMessage(playerid, -1, "=> /mudarchat [1 - 2]");
  751. if(tipo < 1 || tipo > 2)return SendClientMessage(playerid, -1, "=> /mudarchat [1 - 2]");
  752. if(TipoCHAT == tipo)return SendClientMessage(playerid, -1, #Já está sendo usado este modelo);
  753. TextDrawDestroy(TextOutros[0]);TextDrawDestroy(TextOutros[7]);
  754. TextDrawDestroy(TextOutros[2]);TextDrawDestroy(TextOutros[3]);
  755. TextDrawDestroy(TextOutros[4]);TextDrawDestroy(TextLinhas[0]);
  756. TextDrawDestroy(TextLinhas[1]);TextDrawDestroy(TextLinhas[2]);
  757. TextDrawDestroy(TextLinhas[3]);TextDrawDestroy(TextLinhas[4]);
  758. TextDrawDestroy(TextLinhas[5]);TextDrawDestroy(TextLinhas[6]);
  759. TextDrawDestroy(TextLinhas[7]);TextDrawDestroy(TextLinhas[8]);
  760. TextDrawDestroy(TextLinhas[9]);TextDrawDestroy(TextOutros[1]);
  761. CriarCHAT(tipo);
  762. format(stringe, sizeof stringe, "~y~(ADM) %s mudou a posicao do chat.", getnome(playerid));
  763. AtualizarLinhas();strlinhas[9] = stringe;
  764. TextDrawSetString(TextLinhas[9], strlinhas[9]);
  765. for(new i=0;i<MaiorID;i++)if(IsPlayerConnected(i)&&ChatInfo[i][OnCHAT]==1&&ChatInfo[playerid][VendoCHAT]==1)ShowChat(i);}
  766. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  767. return true;
  768. }
  769. CMD:lc(playerid)
  770. {
  771. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 0){
  772. strlinhas[0] = " ";strlinhas[1] = " ";
  773. strlinhas[2] = " ";strlinhas[3] = " ";strlinhas[4] = " ";strlinhas[5] = " ";
  774. strlinhas[6] = " ";strlinhas[7] = " ";strlinhas[8] = " ";strlinhas[9] = " ";
  775. format(stringe, sizeof stringe, "~p~(ADM) %s resetou o chat.", getnome(playerid));
  776. AtualizarLinhas();strlinhas[9] = stringe;
  777. TextDrawSetString(TextLinhas[9], strlinhas[9]);}
  778. else return SendClientMessage(playerid, -1, #Seu nivel de admin do CHAT é muito baixo para fazer isto.);
  779. return true;
  780. }
  781. CMD:ajudachat(playerid)
  782. {
  783. new strajuda[1320];
  784. format(stringe,sizeof stringe,
  785. "*-------------------------------------------[ AJUDA CHAT ]-------------------------------------------*\n");strcat(strajuda,stringe);
  786. format(stringe,sizeof stringe,
  787. "\n{33FF00}LETRA Y ou /CT - {FFFFFF}escreve no chat");strcat(strajuda,stringe);
  788. format(stringe,sizeof stringe,
  789. "\n{33FF00}/LOGARCHAT - {FFFFFF}loga no chat, para poder falar com outros players.");strcat(strajuda,stringe);
  790. format(stringe,sizeof stringe,
  791. "\n{33FF00}/SAIRCHAT - {FFFFFF}sai da conversa no chat.");strcat(strajuda,stringe);
  792. format(stringe,sizeof stringe,
  793. "\n{33FF00}/CHAT - {FFFFFF}esconde/mostra o chat.");strcat(strajuda,stringe);
  794. format(stringe,sizeof stringe,
  795. "\n{33FF00}/BOX - {FFFFFF}ativa/desativa o box do chat.");strcat(strajuda,stringe);
  796. format(stringe,sizeof stringe,
  797. "\n{33FF00}/LINHASCHAT - {FFFFFF}muda a quantidade de linhas que você deseja ver.");strcat(strajuda,stringe);
  798. format(stringe,sizeof stringe,
  799. "\n{33FF00}/ONCHAT - {FFFFFF}usado para ver os players conectados ao chat.");strcat(strajuda,stringe);
  800. format(stringe,sizeof stringe,
  801. "\n{33FF00}/ADMINSCHAT - {FFFFFF}usado para ver os administradores do chat online.");strcat(strajuda,stringe);
  802. format(stringe,sizeof stringe,
  803. "\n{FF0000}[Admin]{33FF00}/MUDARCHAT - {FFFFFF}muda a posição do chat.");strcat(strajuda,stringe);
  804. format(stringe,sizeof stringe,
  805. "\n{FF0000}[Admin]{33FF00}/KICKCHAT - {FFFFFF}kicka um player do chat.");strcat(strajuda,stringe);
  806. format(stringe,sizeof stringe,
  807. "\n{FF0000}[Admin]{33FF00}/CHATSOM - {FFFFFF}muda o som do chat ao escrever.");strcat(strajuda,stringe);
  808. format(stringe,sizeof stringe,
  809. "\n{FF0000}[Admin]{33FF00}/LC - {FFFFFF}limpa as linhas do chat.");strcat(strajuda,stringe);
  810. format(stringe,sizeof stringe,
  811. "\n{FF0000}[Admin]{33FF00}/DESATIVARCHAT - {FFFFFF}desativa o chat de um player em um determinado tempo.");strcat(strajuda,stringe);
  812. format(stringe,sizeof stringe,
  813. "\n{FF0000}[Admin]{33FF00}/MENSAGEMCHAT - {FFFFFF}manda uma mensagem grande no chat.");strcat(strajuda,stringe);
  814. format(stringe,sizeof stringe,
  815. "\n{FF0000}[Admin]{33FF00}/DARADMCHAT - {FFFFFF}promove um player a administrador do chat.");strcat(strajuda,stringe);
  816. format(stringe,sizeof stringe,
  817. "\n{FF0000}[Admin]{33FF00}/BANCHAT - {FFFFFF}ban um jogador do chat.");strcat(strajuda,stringe);
  818. format(stringe,sizeof stringe,
  819. "\n{FF0000}[Admin]{33FF00}/DESBANCHAT - {FFFFFF}desban um jogador do chat.");strcat(strajuda,stringe);
  820. ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX,"Ajuda CHAT", strajuda, "SAIR", "");
  821. return true;
  822. }
  823. CMD:onchat(playerid){
  824. new nochat = 0;
  825. for(new pl = 0;pl<MaiorID;pl++){
  826. if(IsPlayerConnected(pl) && ChatInfo[pl][OnCHAT] == 1){
  827. format(stringe, sizeof stringe, "{FFFFFF}%s {33FF00}(ONLINE)", getnome(pl));
  828. SendClientMessage(playerid, -1, stringe);
  829. nochat = 1;}}
  830. if(nochat == 0)return SendClientMessage(playerid, -1, "Ninguem está online no chat");
  831. return true;
  832. }
  833.  
  834. CMD:adminschat(playerid){
  835. new nochat = 0;
  836. for(new pl = 0;pl<MaiorID;pl++){
  837. if(IsPlayerConnected(pl) && ChatInfo[pl][AdmCHAT] > 0){
  838. format(stringe, sizeof stringe, "{FFFFFF}%s - {33FF00}nivel: %d", getnome(pl),ChatInfo[pl][AdmCHAT]);
  839. SendClientMessage(playerid, -1, stringe);
  840. nochat = 1;}}
  841. if(nochat == 0)return SendClientMessage(playerid, -1, "Nenhum admin do chat online");
  842. return true;
  843. }
  844. CMD:banchat(playerid, params[]){
  845. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 0){
  846. new id, motivo[64];
  847. if(sscanf(params, "us[64]", id, motivo))return SendClientMessage(playerid, -1, "=> /banchat [id][motivo]");
  848. if(ChatInfo[id][Banido] == 1)return SendClientMessage(playerid, -1, "Este player já está banido do chat.");
  849. ChatInfo[id][Banido] = 1;
  850. HideChat(id);ChatInfo[id][OnCHAT] = 0;ChatInfo[id][VendoCHAT] = 0;
  851. format(stringe, sizeof stringe, "~p~(ADM) %s baniu %s: %s.", getnome(playerid), getnome(id), motivo);
  852. AtualizarLinhas();strlinhas[9] = stringe;TextDrawSetString(TextLinhas[9], strlinhas[9]);
  853. for(new i = 0;i < MAX_PLAYERS;i++){
  854. if(strcmp(NicksBanidos[i],"Ninguem",true)==0){
  855. NicksBanidos[i] = getnome(id);return true;}}}
  856. return true;
  857. }
  858. CMD:desbanchat(playerid, params[]){
  859. if(IsPlayerAdmin(playerid) || ChatInfo[playerid][AdmCHAT] > 0){
  860. new nickbanido[74], bani = 0;
  861. if(sscanf(params,"s[74]",nickbanido))return SendClientMessage(playerid, -1, "=> /desbanchat [Nick]");
  862. for(new nick = 0;nick<MAX_PLAYERS;nick++){
  863. if(strcmp(NicksBanidos[nick],nickbanido,true) == 0){
  864. for(new pl=0;pl<MaiorID;pl++){
  865. if(IsPlayerConnected(pl)&&strcmp(getnome(pl),nickbanido,true)==0){
  866. SendClientMessage(pl,-1,"Você foi desbanido do chat");ChatInfo[pl][Banido]=0;}}
  867. NicksBanidos[nick] = "Ninguem";bani = 1;
  868. format(stringe, sizeof stringe, "~p~(ADM) %s desbaniu %s.", getnome(playerid), nickbanido);
  869. AtualizarLinhas();strlinhas[9] = stringe;TextDrawSetString(TextLinhas[9], strlinhas[9]);
  870. SendClientMessage(playerid, -1, stringe);return true;}}
  871. if(bani == 0)return SendClientMessage(playerid, -1, "Este nick não está banido");}
  872. return true;
  873. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement