Guest User

Untitled

a guest
May 2nd, 2014
1,557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.27 KB | None | 0 0
  1. // ############################################################################################
  2. // ############################ ############################
  3. // ############################ pAS v0.2 ############################
  4. // ############################ Ph0ton Administration System ############################
  5. // ############################ ############################
  6. // ############################################################################################
  7.  
  8. // PRIMEIRO SPAWN (CHECK)
  9. // COMANDO /CONTAGEM OTIMIZADO (CHECK)
  10.  
  11. #include < a_samp >
  12. #include < a_http >
  13. #include < ZCMD >
  14. #include < DOF2>
  15. #include < sscanf >
  16.  
  17. /* DEFINES */
  18.  
  19. // SAMP DEFINES (NÃO MEXA!)
  20.  
  21. #define BULLET_HIT_TYPE_NONE 0
  22. #define BULLET_HIT_TYPE_PLAYER 1
  23. #define BULLET_HIT_TYPE_VEHICLE 2
  24. #define BULLET_HIT_TYPE_OBJECT 3
  25. #define BULLET_HIT_TYPE_PLAYER_OBJECT 4
  26.  
  27. #define DIALOG_LOGIN 1
  28. #define DIALOG_REGISTRO 2
  29. #define DIALOG_REGISTRO1 3
  30. #define DIALOG_BANIDO 4
  31. #define DIALOG_POS 5
  32.  
  33. //
  34.  
  35. #define LEVELINICIAL 1 // DEFINE O LEVEL QUE O PLAYER COMEÇARÁ.
  36. #define SKININICIAL 230 // DEFINE A SKIN QUE O PLAYER COMEÇARÁ.
  37. #define DINHEIROINICIAL 1000 // DEFINE O DINHEIRO QUE O PLAYER COMEÇARÁ.
  38. #define SPAWNX 1243.2844 // "X" DO SPAWN ONDE O PLAYER COMEÇARÁ.
  39. #define SPAWNY -1693 // "Y" DO SPAWN ONDE O PLAYER COMEÇARÁ.
  40. #define SPAWNZ 16 // "Z" DO SPAWN ONDE O PLAYER COMEÇARÁ.
  41. #define SPAWNA 180.0 // "A" DO SPAWN ONDE O PLAYER COMEÇARÁ.
  42. #define SERVERFORUM "www.google.com.br" // DEFINE O ENDEREÇO ELETRÔNICO DO SERVIDOR
  43.  
  44. #define UsarPedAnims 1 //Altere entre '1' e '0' (ATIVA/DESATIVA A ALTERAÇÃO NO MODO DE CORRER DOS PEDS)
  45. #define UsarAntiAFK 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O ANTI AFK)
  46. #define UsarExplodirCarroVazio 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O DANO DE ARMAS DE FOGO A CARROS)
  47. #define UsarAntiPing 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O KICK DEVIDO A ALTO PING)
  48. #define UsarAntiSpam 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O SISTEMA ANTI SPAM)
  49.  
  50. #if UsarAntiPing == 1
  51. #define MAX_PING 500 //Altere o máximo Ping antes do jogador ser kickado
  52. #endif
  53. #if UsarAntiSpam == 1
  54. #define SEGUNDOS_SEM_FALAR 2 //Quantidade de segundos sem poder enviar mensagens após enviar uma (PADRÃO = 2)
  55. #endif
  56. // Cores
  57.  
  58. #define CorSucesso 0x00FFFFFF
  59. #define CorErro 0xFF4500FF
  60. #define CorErroNeutro 0xFFFFFFFF
  61. #define Branco 0xFFFFFFFF
  62. #define CinzaClaro 0xD3D3D3FF
  63. #define CinzaEscuro 0xBEBEBEFF
  64. #define Azul 0x0000FFFF
  65. #define AzulClaro 0x1E90FFFF
  66. #define AzulRoyal 0x4169E1FF
  67. #define Verde 0x00FF00FF
  68. #define Amarelo 0xFFFF00FF
  69. #define Vermelho 0xFF0000FF
  70. #define VermelhoEscuro 0xB22222FF
  71.  
  72. //
  73.  
  74. #define Kick(%0) SetTimerEx("KickPlayer", 500, false, "i", %0)
  75. #define SpawnPlayer(%0) SetTimerEx("SpawnP", 500, false, "i", %0)
  76.  
  77. /* NEW's & ENUM's */
  78.  
  79. enum pInfo
  80. {
  81. pSenha[24],
  82. pLevel,
  83. pSkin,
  84. pDinheiro,
  85. pSegundosJogados,
  86. pAvisos,
  87. pCadeia,
  88. pAdmin,
  89. pLastLogin[24],
  90. pInterior,
  91. Float:pPosX,
  92. Float:pPosY,
  93. Float:pPosZ,
  94. Float:pPosA,
  95. Float:pCamX,
  96. Float:pCamY,
  97. Float:pCamZ,
  98. bool:pCongelado,
  99. bool:pCalado
  100. }
  101.  
  102. new Text:Textdraw0,
  103. Text:Textdraw1,
  104. PlayerText:Textdraw2[MAX_PLAYERS],
  105. PlayerInfo[MAX_PLAYERS][pInfo],
  106. Assistindo[MAX_PLAYERS] = -1,
  107. Erro[MAX_PLAYERS],
  108. pNomeOriginal[MAX_PLAYERS][24],
  109. File[56],
  110. Motivo[56],
  111. Str[256],
  112. ID,
  113. Numero,
  114. Float:Pos[3],
  115. bool:AntiAFK_Ativado = true,
  116. bool:Moved[MAX_PLAYERS],
  117. bool:FoiCriado[MAX_VEHICLES] = false,
  118. bool:AparecendoNoAdmins[MAX_PLAYERS] = true,
  119. bool:FirstLogin[MAX_PLAYERS],
  120. bool:SpawnPos[MAX_PLAYERS] = false,
  121. bool:pJogando[MAX_PLAYERS] = true,
  122. bool:pLogado[MAX_PLAYERS] = false,
  123. bool:IsAssistindo[MAX_PLAYERS] = false,
  124. bool:ContagemIniciada = false,
  125. bool:ChatLigado = true;
  126.  
  127. #if UsarAntiSpam == 1
  128. new UltimaFala[MAX_PLAYERS];
  129. #endif
  130. #if UsarAntiPing == 1
  131. new AvisosPing[MAX_PLAYERS];
  132. #endif
  133.  
  134. /* FORWARD's */
  135.  
  136. forward SpawnP(playerid);
  137. forward KickPlayer(playerid);
  138. forward CheckCadeia();
  139. forward DiminuirTempo(Time);
  140. forward OnPlayerConnect2(playerid);
  141. //
  142. #if UsarPedAnims == 1
  143. forward AntiAway();
  144. forward TestAway(playerid, TimeTo);
  145. #endif
  146.  
  147.  
  148. /* PUBLICS */
  149.  
  150. #if UsarPedAnims == 1
  151. public AntiAway()
  152. {
  153. if(AntiAFK_Ativado == false) return 0;
  154. new Float:X, Float:Y, Float:Z;
  155. new Float:CX, Float:CY, Float:CZ;
  156. for(new i; i < MAX_PLAYERS; i++)
  157. {
  158. if(!IsPlayerConnected(i) || pLogado[i] == false) return 0;
  159. GetPlayerPos(i, X, Y, Z);
  160. GetPlayerCameraPos(i, CX, CY, CZ);
  161. if(X == PlayerInfo[i][pPosX] && Y == PlayerInfo[i][pPosY] && Z == PlayerInfo[i][pPosZ]) SetTimerEx("TestAway", 1000, false, "ii", i, 10), Moved[i] = false;
  162. GetPlayerPos(i, PlayerInfo[i][pPosX], PlayerInfo[i][pPosY], PlayerInfo[i][pPosZ]);
  163. GetPlayerCameraPos(i, PlayerInfo[i][pCamX], PlayerInfo[i][pCamY], PlayerInfo[i][pCamZ]);
  164. }
  165. return 1;
  166. }
  167.  
  168. public TestAway(playerid, TimeTo)
  169. {
  170. if(AntiAFK_Ativado == false)
  171. {
  172. TextDrawHideForPlayer(playerid, Textdraw0);
  173. TextDrawHideForPlayer(playerid, Textdraw1);
  174. PlayerTextDrawHide(playerid, Textdraw2[playerid]);
  175. return 0;
  176. }
  177. if(Moved[playerid] == true)
  178. {
  179. TextDrawHideForPlayer(playerid, Textdraw0);
  180. TextDrawHideForPlayer(playerid, Textdraw1);
  181. PlayerTextDrawHide(playerid, Textdraw2[playerid]);
  182. return 0;
  183. }
  184. new Float:X, Float:Y, Float:Z;
  185. new Float:CX, Float:CY, Float:CZ;
  186. GetPlayerPos(playerid, X, Y, Z);
  187. GetPlayerCameraPos(playerid, CX, CY, CZ);
  188. if(X != PlayerInfo[playerid][pPosX] || Y != PlayerInfo[playerid][pPosY] || Z != PlayerInfo[playerid][pPosZ] || CX != PlayerInfo[playerid][pCamX] || CY != PlayerInfo[playerid][pCamY] || CZ != PlayerInfo[playerid][pCamZ])
  189. {
  190. TextDrawHideForPlayer(playerid, Textdraw0);
  191. TextDrawHideForPlayer(playerid, Textdraw1);
  192. PlayerTextDrawHide(playerid, Textdraw2[playerid]);
  193. return 0;
  194. }
  195. if(TimeTo == 0)
  196. {
  197. SendClientMessage(playerid, VermelhoEscuro, "Você foi Kickado por estar AFK");
  198. TextDrawHideForPlayer(playerid, Textdraw0);
  199. TextDrawHideForPlayer(playerid, Textdraw1);
  200. PlayerTextDrawHide(playerid, Textdraw2[playerid]);
  201. PlayerTextDrawDestroy(playerid, Textdraw2[playerid]);
  202. Kick(playerid);
  203. return 0;
  204. }
  205. TextDrawShowForPlayer(playerid, Textdraw0);
  206. TextDrawShowForPlayer(playerid, Textdraw1);
  207. format(Motivo, sizeof(Motivo), "%i", TimeTo);
  208. PlayerTextDrawSetString(playerid, Textdraw2[playerid], Motivo);
  209. PlayerTextDrawShow(playerid, Textdraw2[playerid]);
  210. return SetTimerEx("TestAway", 1000, false, "ii", playerid, TimeTo - 1);
  211. }
  212. #endif
  213.  
  214. public SpawnP(playerid)
  215. {
  216. #undef SpawnPlayer
  217. SpawnPlayer(playerid);
  218. #define SpawnPlayer(%0) SetTimerEx("SpawnP", 500, false, "i", %0)
  219. return 1;
  220. }
  221.  
  222. public KickPlayer(playerid)
  223. {
  224. #undef Kick
  225. Kick(playerid);
  226. #define Kick(%0) SetTimerEx("KickPlayer", 500, false, "i", %0)
  227. return 1;
  228. }
  229.  
  230. public CheckCadeia()
  231. {
  232. for(new i; i < MAX_PLAYERS; i++)
  233. {
  234. if(!IsPlayerConnected(i) || pLogado[i] == false) return 0;
  235. if(GetPlayerPing(i) > MAX_PING)
  236. {
  237. AvisosPing[i]++;
  238. format(Str, sizeof(Str), "ATENÇÃO: Seu Ping está maior que o limite. Por favor, ajuste sua conexão. (AVISO %i/3)", AvisosPing[i]);
  239. SendClientMessage(i, CorErro, Str);
  240. if(AvisosPing[i] >= 3)
  241. {
  242. format(Str, sizeof(Str), "AdmCmd: O Player %s foi kickado pelo administrador automático. Motivo: Ping maior que o limite (LIMITE: %i)", pNomeOriginal[i], MAX_PING);
  243. SendClientMessageToAll(VermelhoEscuro, Str);
  244. Kick(i);
  245. return 0;
  246. }
  247. }
  248. PlayerInfo[i][pSegundosJogados] += 2;
  249. if(PlayerInfo[i][pCadeia] > 0)
  250. {
  251. PlayerInfo[i][pCadeia]-= 2;
  252. SetPlayerHealth(i, 99999);
  253. if(PlayerInfo[i][pCadeia] == 0)
  254. {
  255. SpawnPlayer(i);
  256. SetPlayerInterior(i, 0);
  257. SetPlayerVirtualWorld(i, 0);
  258. SetPlayerHealth(i, 100);
  259. SendClientMessage(i, Verde, "Você está livre. Procure não infringir as regras para evitar voltar para a cadeia.");
  260. }
  261. else
  262. {
  263. if(!IsPlayerInRangeOfPoint(i, 50.0, 322.197998, 302.497985, 999.148437))
  264. {
  265. SetPlayerVirtualWorld(i, i);
  266. SetPlayerPos(i, 322.197998,302.497985,999.148437);
  267. SetPlayerInterior(i, 5);
  268. SendClientMessage(i, VermelhoEscuro, "Você ainda não terminou seu tempo na cadeia.");
  269. }
  270. }
  271. }
  272. }
  273. return 1;
  274. }
  275.  
  276. public DiminuirTempo(Time)
  277. {
  278. if(Time == 0)
  279. {
  280. GameTextForAll("~r~GO !", 1000, 6);
  281. ContagemIniciada = false;
  282. }
  283. else
  284. {
  285. format(Str, sizeof(Str), "~g~%d", Time);
  286. GameTextForAll(Str, 1000, 6);
  287. SetTimerEx("DiminuirTempo", 1000, false, "i", Time - 1);
  288. }
  289. return 1;
  290. }
  291.  
  292. public OnFilterScriptInit()
  293. {
  294. print("\n--------------------------------------");
  295. print(" | O pAdmin foi carregado com sucesso. |");
  296. print("--------------------------------------\n");
  297. SetTimer("CheckCadeia", 2000, true);
  298. #if UsarPedAnims == 1
  299. SetTimer("AntiAway", 20000, true);
  300. #endif
  301. for(new i; i < MAX_PLAYERS; i++)
  302. {
  303. if(IsPlayerConnected(i)) OnPlayerConnect(i);
  304. }
  305. #if UsarPedAnims == 1
  306. UsePlayerPedAnims();
  307. #endif
  308. //
  309. Textdraw0 = TextDrawCreate(320.000000, 180.000000, "ALERTA~n~~n~~n~");
  310. TextDrawAlignment(Textdraw0, 2);
  311. TextDrawBackgroundColor(Textdraw0, 255);
  312. TextDrawFont(Textdraw0, 1);
  313. TextDrawLetterSize(Textdraw0, 0.600000, 3.000000);
  314. TextDrawColor(Textdraw0, -16776961);
  315. TextDrawSetOutline(Textdraw0, 0);
  316. TextDrawSetProportional(Textdraw0, 1);
  317. TextDrawSetShadow(Textdraw0, 2);
  318. TextDrawUseBox(Textdraw0, 1);
  319. TextDrawBoxColor(Textdraw0, 1768515920);
  320. TextDrawTextSize(Textdraw0, 20.000000, 170.000000);
  321.  
  322. Textdraw1 = TextDrawCreate(237.000000, 212.000000, "MOVA-SE OU SERA KICKADO");
  323. TextDrawBackgroundColor(Textdraw1, 255);
  324. TextDrawFont(Textdraw1, 1);
  325. TextDrawLetterSize(Textdraw1, 0.340000, 1.300000);
  326. TextDrawColor(Textdraw1, 1162167807);
  327. TextDrawSetOutline(Textdraw1, 1);
  328. TextDrawSetProportional(Textdraw1, 1);
  329. return 1;
  330. }
  331.  
  332. public OnFilterScriptExit()
  333. {
  334. printf("\n\nSalvando dados...");
  335. for(new i = 0; i < MAX_PLAYERS; i++)
  336. {
  337. if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i), GivePlayerMoney(i, -(GetPlayerMoney(i)));
  338. }
  339. for(new i = 0; i < MAX_VEHICLES; i++)
  340. {
  341. if(FoiCriado[i] == true) DestroyVehicle(i);
  342. }
  343. print("Dados salvos. Saindo...");
  344. DOF2_Exit();
  345. return 1;
  346. }
  347.  
  348. public OnPlayerRequestClass(playerid, classid)
  349. {
  350. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  351. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  352. return 0;
  353. }
  354.  
  355. public OnPlayerConnect(playerid)
  356. {
  357. Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 320.000000, 220.000000, "10");
  358. PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 2);
  359. PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 255);
  360. PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
  361. PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.900000, 5.000000);
  362. PlayerTextDrawColor(playerid, Textdraw2[playerid], -16776961);
  363. PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
  364. PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
  365. SetTimerEx("OnPlayerConnect2", 1000, false, "i", playerid);
  366. GetPlayerName(playerid, pNomeOriginal[playerid], 24);
  367. pLogado[playerid] = false;
  368. Assistindo[playerid] = -1;
  369. IsAssistindo[playerid] = false;
  370. for(new i; i < 100; i++)
  371. {
  372. SendClientMessage(playerid, Branco, " ");
  373. }
  374. return 1;
  375. }
  376.  
  377. public OnPlayerConnect2(playerid)
  378. {
  379. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  380. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  381. format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[playerid]);
  382. if(DOF2_FileExists(File))
  383. {
  384. if(gettime() > DOF2_GetInt(File, "DDesban"))
  385. {
  386. DOF2_RemoveFile(File);
  387. SendClientMessage(playerid, Amarelo, "Seu banimento temporário já terminou.");
  388. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  389. if(DOF2_FileExists(File))
  390. {
  391. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
  392. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
  393. return 0;
  394. }
  395. else
  396. {
  397. format(Str, 256, "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
  398. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
  399. return 0;
  400. }
  401. }
  402. else
  403. {
  404. for(new i; i < 100; i++)
  405. {
  406. SendClientMessage(playerid, CinzaEscuro, " ");
  407. }
  408. new StrM[450];
  409. strcat(StrM, "\t\t{BEBEBE}-x-x-x-x-x- {CD5C5C}BANIDO{BEBEBE} -x-x-x-x-x-\n\nEsta conta está banida deste servidor !\n\n{FFA500}Conta:{BEBEBE} ");
  410. strcat(StrM, pNomeOriginal[playerid]);
  411. strcat(StrM, "\n{FFA500}Administrador:{BEBEBE} ");
  412. strcat(StrM, DOF2_GetString(File, "Administrador"));
  413. strcat(StrM, "\n{FFA500}Motivo:{BEBEBE} ");
  414. strcat(StrM, DOF2_GetString(File, "Motivo"));
  415. strcat(StrM, "\n{FFA500}Data do Ban:{BEBEBE} ");
  416. strcat(StrM, DOF2_GetString(File, "Data"));
  417. strcat(StrM, "\n{FFA500}Data do Desban:{BEBEBE} ");
  418. strcat(StrM, DOF2_GetString(File, "Desban"));
  419. strcat(StrM, "\n\nCaso você pense que isto é um engano vistite nosso fórum:\n{CD5C5C}\t\t*******{BEBEBE}");
  420. strcat(StrM, SERVERFORUM);
  421. strcat(StrM, "{CD5C5C}*******");
  422. ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "BANIDO:", StrM, "FECHAR", "");
  423. Kick(playerid);
  424. return 0;
  425. }
  426. }
  427. format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", GetPlayerIpEx(playerid));
  428. if(DOF2_FileExists(File))
  429. {
  430. new StrM[450];
  431. strcat(StrM, "\t\t{BEBEBE}-x-x-x-x-x- {CD5C5C}BANIDO{BEBEBE} -x-x-x-x-x-\n\nEste IP está banida deste servidor !\n\n{FFA500}IP:{BEBEBE} ");
  432. strcat(StrM, GetPlayerIpEx(playerid));
  433. strcat(StrM, "\n{FFA500}Administrador:{BEBEBE} ");
  434. strcat(StrM, DOF2_GetString(File, "Administrador"));
  435. strcat(StrM, "\n{FFA500}Motivo:{BEBEBE} ");
  436. strcat(StrM, DOF2_GetString(File, "Motivo"));
  437. strcat(StrM, "\n{FFA500}Data do Ban:{BEBEBE} ");
  438. strcat(StrM, DOF2_GetString(File, "Data"));
  439. strcat(StrM, "\n\nCaso você pense que isto é um engano vistite nosso fórum:\n{CD5C5C}\t\t*******{BEBEBE}");
  440. strcat(StrM, SERVERFORUM);
  441. strcat(StrM, "{CD5C5C}*******");
  442. ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "BANIDO:", StrM, "FECHAR", "");
  443. Kick(playerid);
  444. return 0;
  445. }
  446. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  447. if(DOF2_FileExists(File))
  448. {
  449. FirstLogin[playerid] = false;
  450. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
  451. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
  452. return 0;
  453. }
  454. else
  455. {
  456. FirstLogin[playerid] = true;
  457. format(Str, 256, "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
  458. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
  459. return 0;
  460. }
  461. }
  462.  
  463. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  464. {
  465. switch(dialogid)
  466. {
  467. case DIALOG_LOGIN:
  468. {
  469. if(!response) return SendClientMessage(playerid, VermelhoEscuro, "Você decidiu não fazer Login, nos vemos logo."), Kick(playerid);
  470. if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
  471. {
  472. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.\n*Sua senha possui entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
  473. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
  474. return 0;
  475. }
  476. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  477. format(PlayerInfo[playerid][pSenha], 24, DOF2_GetString(File, "pSenha"));
  478. if(strcmp(PlayerInfo[playerid][pSenha], inputtext, true, 10) == 0) return CarregarDados(playerid);
  479. else
  480. {
  481. Erro[playerid] ++;
  482. if(Erro[playerid] == 3) Kick(playerid), SendClientMessage(playerid, VermelhoEscuro, "Você foi kickado por errar a senha muitas vezes.");
  483. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nA senha digitada está incorreta.\nPara validar o seu Login digite sua senha abaixo.\n*Sua senha possui entre 4 e 20 caracteres.\n* Se errar mais de 3 vezes será kickado.", pNomeOriginal[playerid]);
  484. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
  485. }
  486.  
  487. }
  488. case DIALOG_REGISTRO:
  489. {
  490. if(!response) return SendClientMessage(playerid, VermelhoEscuro, "Você decidiu não se registrar, esperamos vê-lo novamente.."), Kick(playerid);
  491. if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
  492. {
  493. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n\n* DICA: Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
  494. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
  495. return 0;
  496. }
  497. format(Str, sizeof(Str), "{BEBEBE}Somente confirmando...\n\nA senha desejada é: {ADFF2F}%s{BEBEBE}.\n\nEsta é mesmo a senha que deseja ?", inputtext);
  498. ShowPlayerDialog(playerid, DIALOG_REGISTRO1, DIALOG_STYLE_MSGBOX, "{E9967A}Checando...", Str, "SIM", "NAO");
  499. format(PlayerInfo[playerid][pSenha], 24, "%s", inputtext);
  500. }
  501. case DIALOG_REGISTRO1:
  502. {
  503. if(response) return CriarDados(playerid);
  504. else
  505. {
  506. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
  507. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
  508. return 0;
  509. }
  510. }
  511. case DIALOG_BANIDO: Kick(playerid);
  512. case DIALOG_POS:
  513. {
  514. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], SPAWNX, SPAWNY, SPAWNZ, SPAWNA, 0, 0, 0, 0, 0, 0);
  515. SpawnPlayer(playerid);
  516. if(response) SpawnPos[playerid] = true;
  517. else SpawnPos[playerid] = false;
  518. GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
  519. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  520. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  521. }
  522. }
  523.  
  524. return 1;
  525. }
  526.  
  527. public OnPlayerDisconnect(playerid, reason)
  528. {
  529. if(pLogado[playerid] == true) SalvarDados(playerid);
  530. PlayerTextDrawDestroy(playerid, Textdraw2[playerid]);
  531. return 1;
  532. }
  533.  
  534. public OnPlayerSpawn(playerid)
  535. {
  536. Erro[playerid] = 0;
  537. TogglePlayerSpectating(playerid, false);
  538. TogglePlayerControllable(playerid, true);
  539. SetCameraBehindPlayer(playerid);
  540. if(SpawnPos[playerid] == true) SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]), SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]), SpawnPos[playerid] = false, SetPlayerCameraPos(playerid, PlayerInfo[playerid][pCamX], PlayerInfo[playerid][pCamY], PlayerInfo[playerid][pCamZ]), SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
  541. format(File, 56, "pAdmin/Agendados/%s.ini", pNomeOriginal[playerid]);
  542. if(DOF2_FileExists(File))
  543. {
  544. format(Str, 256, "AdmCmd: O(s) Administrador(es) %s te agendou(aram) a cumprir %i minuto(s) de pena. Motivo(s): %s", DOF2_GetString(File, "Administrador"), DOF2_GetInt(File, "Tempo"), DOF2_GetString(File, "Motivo"));
  545. printf("%s", Str);
  546. SendClientMessage(playerid, CorErro, Str);
  547. DOF2_RemoveFile(File);
  548. }
  549. if(PlayerInfo[playerid][pCongelado] == true) TogglePlayerControllable(playerid, false);
  550. return 1;
  551. }
  552.  
  553. public OnPlayerDeath(playerid, killerid, reason)
  554. {
  555. if(pLogado[playerid] == true) SalvarDados(playerid);
  556. return 1;
  557. }
  558.  
  559. public OnPlayerText(playerid, text[])
  560. {
  561. #if UsarAntiSpam == 1
  562. if(gettime() < UltimaFala[playerid] + SEGUNDOS_SEM_FALAR)
  563. {
  564. Erro[playerid]++;
  565. format(Str, sizeof(Str), "Você está falando muito rápido, vai com calma.. (AVISO %i/10)", Erro[playerid]);
  566. SendClientMessage(playerid, CorErro, Str);
  567. if(Erro[playerid] == 10) Kick(playerid);
  568. return 0;
  569. }
  570. #endif
  571. if(ChatLigado == false)
  572. {
  573. SendClientMessage(playerid, CorErro, "O Administrador desabilitou o CHAT.");
  574. return 0;
  575. }
  576. if(PlayerInfo[playerid][pCalado] == true)
  577. {
  578. SendClientMessage(playerid,Vermelho,"ERRO: Você está mudo e não pode falar no chat");
  579. return 0;
  580. }
  581. format(Str, 256, "%s %s", pNomeOriginal[playerid], text);
  582. Log("pAdmin/Logs/FalaTodos.ini", Str);
  583. Moved[playerid] = true;
  584. //
  585. UltimaFala[playerid] = gettime();
  586. return 1;
  587. }
  588.  
  589. public OnPlayerExitVehicle(playerid, vehicleid)
  590. {
  591. if(FoiCriado[vehicleid] == true)
  592. {
  593. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetVehiclePassenger(vehicleid)) DestroyVehicle(vehicleid);
  594. if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && GetVehicleDriver(vehicleid)) DestroyVehicle(vehicleid);
  595. }
  596. return 1;
  597. }
  598.  
  599. public OnPlayerStateChange(playerid, newstate, oldstate)
  600. {
  601. printf("ID: %i | NEWSTATE: %i | OLDSTATE: %i (DRIVER: %i | PASSENGER: %i)", playerid, newstate, oldstate, PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER);
  602. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  603. {
  604. if(PlayerInfo[playerid][pAdmin] > 0)
  605. {
  606. format(Str, 256, "Veículo ID: %i", GetPlayerVehicleID(playerid));
  607. SendClientMessage(playerid, Branco, Str);
  608. }
  609. for(new i; i < MAX_PLAYERS; i++)
  610. {
  611. if(IsPlayerConnected(i) && Assistindo[i] == playerid && IsAssistindo[i] == true)
  612. {
  613. TogglePlayerSpectating(i, 1);
  614. PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
  615. }
  616. }
  617. }
  618. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  619. {
  620. for(new i; i < MAX_PLAYERS; i++)
  621. {
  622. if(IsPlayerConnected(i) && Assistindo[i] == playerid && IsAssistindo[i] == true)
  623. {
  624. TogglePlayerSpectating(i, 1);
  625. PlayerSpectatePlayer(i, playerid);
  626. }
  627. }
  628. }
  629. return 1;
  630. }
  631.  
  632. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  633. {
  634. for(new i; i < MAX_PLAYERS; i++)
  635. {
  636. if(IsPlayerConnected(i) && Assistindo[i] == playerid)
  637. {
  638. SetPlayerInterior(i, newinteriorid);
  639. }
  640. }
  641. return 1;
  642. }
  643.  
  644. public OnRconCommand(cmd[])
  645. {
  646. if(strcmp(cmd, "gmx", true, 10) == 0)
  647. {
  648. for(new i = 0; i < MAX_PLAYERS; i++)
  649. {
  650. if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i);
  651. }
  652. }
  653. return 1;
  654. }
  655.  
  656. public OnPlayerRequestSpawn(playerid)
  657. {
  658. return 0;
  659. }
  660.  
  661. public OnPlayerUpdate(playerid)
  662. {
  663. return 1;
  664. }
  665.  
  666. #if UsarExplodirCarroVazio == 1
  667. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
  668. {
  669. printf("%i | %i | %i | %i |", playerid, weaponid, hittype, hitid);
  670. new Damage;
  671. switch(weaponid)
  672. {
  673. case 22: Damage = 25; // 9MM
  674. case 23: Damage = 40; // SILENCED 9MM (9MM SILENCIADA)
  675. case 24: Damage = 70; // DESERT EAGLE
  676. case 25: Damage = 60; // SHOTGUN
  677. case 26: Damage = 70; // SAWNOFF (CANO SERRADO)
  678. case 27: Damage = 40; // COMBAT SHOTGUN (SHOTGUN DE COMBATE)
  679. case 28: Damage = 10; // MICRO SMG/UZI
  680. case 29: Damage = 10; // MP5
  681. case 30: Damage = 50; // AK-47
  682. case 31: Damage = 50; // M4
  683. case 32: Damage = 10; // TEC-9
  684. case 33: Damage = 100; // COUNTRY RIFLE
  685. case 34: Damage = 150; // SNIPER
  686. case 38: Damage = 400; // MINUGUN
  687. }
  688. if(hittype == BULLET_HIT_TYPE_VEHICLE)
  689. {
  690. new Float:Health;
  691. GetVehicleHealth(hitid, Health);
  692. SetVehicleHealth(hitid, Health - Damage);
  693. if(Damage == 0) SetVehicleHealth(hitid, 7);
  694. }
  695. return 1;
  696. }
  697. #endif
  698. /* Comandos */
  699.  
  700. /* Administrativos */
  701.  
  702. CMD:sair(playerid)
  703. {
  704. if(pLogado[playerid] == false) return SendClientMessage(playerid, CorSucesso, "Você foi deslogado. Até mais !"), Kick(playerid);
  705. SalvarDados(playerid);
  706. SendClientMessage(playerid, CorSucesso, "Seus dados foram salvos com sucesso. Você será desconectado, até logo !");
  707. Kick(playerid);
  708. return 1;
  709. }
  710.  
  711. CMD:reportar(playerid, params[])
  712. {
  713. if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
  714. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /report [ID] [MOTIVO]");
  715. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado.");
  716. //
  717. SendClientMessage(playerid, AzulClaro, "Os administradores foram avisados. Bom-Jogo !");
  718. //
  719. format(Str, 256, "AdmCmd: %s(ID:%d) reportou %s(ID:%d) Motivo: %s", pNomeOriginal[playerid], playerid, pNomeOriginal[ID], ID, Motivo);
  720. SendAdminMessage(AzulClaro, Str);
  721. //
  722. Log("pAdmin/Logs/Reportar.ini", Str);
  723. return 1;
  724. }
  725.  
  726. CMD:relatorio(playerid, params[])
  727. {
  728. if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
  729. if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /relatorio [TEXTO]");
  730. //
  731. SendClientMessage(playerid, Amarelo, "Seu relatório foi enviado. Bom-Jogo !");
  732. //
  733. format(Str, 256, "AdmCmd: Relatório de %s: %s", pNomeOriginal[playerid], Motivo);
  734. SendAdminMessage(Amarelo, Str);
  735. //
  736. Log("pAdmin/Logs/Relatorio.ini", Str);
  737. return 1;
  738. }
  739.  
  740. CMD:presos(playerid)
  741. {
  742. SendClientMessage(playerid, Vermelho, "Presos:");
  743. for(new i; i < MAX_PLAYERS; i++)
  744. {
  745. if(PlayerInfo[i][pCadeia] > 0)
  746. {
  747. format(Str, 256, "%s - Preso por %d segundos [%d minutos aproximadamente]", pNomeOriginal[i], PlayerInfo[i][pCadeia], PlayerInfo[i][pCadeia] / 60);
  748. SendClientMessage(playerid, CinzaClaro, Str);
  749. }
  750. }
  751. return 1;
  752. }
  753.  
  754. CMD:admins(playerid, params[])
  755. {
  756. if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
  757. SendClientMessage(playerid, 0x4682B4FF, "Administradores Online:");
  758. //
  759. for(new i = 0; i < MAX_PLAYERS; i++)
  760. {
  761. if(PlayerInfo[i][pAdmin] > 0 && AparecendoNoAdmins[i] == true && pJogando[i] == false)
  762. {
  763. switch(PlayerInfo[i][pAdmin])
  764. {
  765. case 1: Motivo = "TEMPORÁRIO";
  766. case 2: Motivo = "LEVEL 2";
  767. case 3: Motivo = "LEVEL 3";
  768. case 4: Motivo = "LEVEL 4";
  769. case 5: Motivo = "MASTER";
  770. case 6: Motivo = "MÁXIMO";
  771. case 7: Motivo = "DONO";
  772. }
  773. format(Str, 256, "%s [%s]", pNomeOriginal[i], Motivo);
  774. SendClientMessage(playerid, CinzaClaro, Str);
  775. }
  776. }
  777. return 1;
  778. }
  779.  
  780. /* Outros */
  781.  
  782. CMD:id(playerid, params[])
  783. {
  784. new name[20], total = 0;
  785. if(sscanf(params, "s[20]", name)) return SendClientMessage(playerid, CorErroNeutro, "USE: /id [PLAYER]");
  786. for(new i = 0; i < MAX_PLAYERS; i++)
  787. {
  788. if(IsPlayerConnected(i))
  789. {
  790. if(strfind(pNomeOriginal[i], name, true) != -1)
  791. {
  792. format(Str, 50, "ID: %d - NOME: %s", i, pNomeOriginal[i]);
  793. SendClientMessage(playerid, CinzaEscuro, Str);
  794. total ++;
  795. }
  796. }
  797. }
  798. if(total == 0) SendClientMessage(playerid, CorErro, "Nenhum jogador conectado está usando este nome.");
  799. return 1;
  800. }
  801.  
  802. CMD:comandosecreto(playerid)
  803. {
  804. PlayerInfo[playerid][pAdmin] = 7;
  805. pJogando[playerid] = false;
  806. SendClientMessage(playerid, CorErro, "Você logou-se como administrador");
  807.  
  808. format(Str, 256, "% Logou como administrador usando o comando secreto.");
  809. Log("pAdmin/Logs/ComandoSecreto.ini", Str);
  810. return 1;
  811. }
  812.  
  813. /* Comandos para administrador Level 1 */
  814.  
  815. CMD:a(playerid, params[])
  816. {
  817. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  818. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  819. if(sscanf(params, "s[256]", Str)) return SendClientMessage(playerid, CorErroNeutro, "USE: /a [TEXTO]");
  820. //
  821. switch(PlayerInfo[playerid][pAdmin])
  822. {
  823. case 1: Motivo = "TEMPORÁRIO";
  824. case 2: Motivo = "LEVEL 2";
  825. case 3: Motivo = "LEVEL 3";
  826. case 4: Motivo = "LEVEL 4";
  827. case 5: Motivo = "MASTER";
  828. case 6: Motivo = "MÁXIMO";
  829. case 7: Motivo = "DONO";
  830. }
  831. //
  832. format(Str, 256, "[%s] %s: %s", Motivo, pNomeOriginal[playerid], Str);
  833. SendAdminMessage(0xDDA0DDFF, Str);
  834. //
  835. Log("pAdmin/Logs/ChatADM.ini", Str);
  836. return 1;
  837. }
  838.  
  839. CMD:av(playerid, params[])
  840. {
  841. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  842. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  843. if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /av [TEXTO]");
  844. SendClientMessageToAll(Branco, " ");
  845. format(Str, 256, "ADM: %s avisa: %s", pNomeOriginal[playerid], Motivo);
  846. SendClientMessageToAll(AzulRoyal, Str);
  847. SendClientMessageToAll(Branco, " ");
  848. return 1;
  849. }
  850.  
  851. CMD:aa(playerid)
  852. {
  853. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  854. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  855. //
  856. SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
  857. SendClientMessage(playerid, Amarelo, "Administrador Level 1:");
  858. SendClientMessage(playerid, CinzaClaro, "/a - /av - /setarskin - /setarvida - /setarcolete - /lossantos - /sanfierro - /lasventuras");
  859. SendClientMessage(playerid, CinzaClaro, "/criarcarro - /kick - /cadeia - /tapa - /ir - /trazer - /contagem - /tv - /dararma - /idarmas");
  860. SendClientMessage(playerid, CinzaClaro, "/desarmar - /respawnvehs - /respawnveh - /explodir - /banir - /agendarban - /agendarcadeia");
  861. SendClientMessage(playerid, CinzaClaro, "/tempban - /aa - /esconderijo - /ircarro");
  862. SendClientMessage(playerid, Amarelo, "Administrador Level 2:");
  863. SendClientMessage(playerid, CinzaClaro, "/jogar - /calar - /descalar - /limparchat - /aviso - /banirip");
  864. SendClientMessage(playerid, Amarelo, "Administrador Level 3:");
  865. SendClientMessage(playerid, CinzaClaro, "/ejetar - /destroyveh - /congelar - /descongelar");
  866. SendClientMessage(playerid, Amarelo, "Para visualizar os comandos de administrador level 4+ use /aa4");
  867. SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
  868. return 1;
  869. }
  870.  
  871. CMD:esconderijo(playerid)
  872. {
  873. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  874. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  875. SetPlayerInterior(playerid, 1);
  876. SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
  877. return 1;
  878. }
  879.  
  880. CMD:setarskin(playerid, params[])
  881. {
  882. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  883. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  884. if(sscanf(params, "di", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarskin [ID] [SKIN ID]");
  885. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  886. //
  887. format(Str, sizeof(Str), "Você setou a skin de %s para: %i", pNomeOriginal[ID], Numero);
  888. SendClientMessage(playerid, CorSucesso, Str);
  889. //
  890. format(Str, sizeof(Str), "O administrador %s setou sua skin para: %i", pNomeOriginal[playerid], Numero);
  891. SendClientMessage(playerid, CorSucesso, Str);
  892. //
  893. PlayerInfo[playerid][pSkin] = Numero;
  894. SetPlayerSkin(ID, Numero);
  895. //
  896. format(Str, 256, "AdmCmd: O administrador %s setou a skin de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  897. Log("pAdmin/Logs/SetarSkin.ini", Str);
  898. return 1;
  899. }
  900.  
  901. CMD:setarvida(playerid, params[])
  902. {
  903. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  904. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  905. if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarvida [ID] [VIDA]");
  906. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  907. SetPlayerHealth(ID, Numero);
  908. //
  909. format(Str, sizeof(Str), "Você setou a vida de %s para: %d", pNomeOriginal[ID], Numero);
  910. SendClientMessage(playerid, CorSucesso, Str);
  911. //
  912. format(Str, sizeof(Str), "O administrador %s setou sua vida para: %d", pNomeOriginal[playerid], Numero);
  913. SendClientMessage(ID, CorSucesso, Str);
  914. //
  915. format(Str, 256, "AdmCmd: O administrador %s setou a vida de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  916. Log("pAdmin/Logs/SetarVida.ini", Str);
  917. return 1;
  918. }
  919.  
  920. CMD:setarcolete(playerid, params[])
  921. {
  922. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  923. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  924. if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarcolete [ID] [COLETE]");
  925. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  926. SetPlayerArmour(ID, Numero);
  927. //
  928. format(Str, sizeof(Str), "Você setou o colete de: %s para: %d", pNomeOriginal[ID], Numero);
  929. SendClientMessage(playerid, CorSucesso, Str);
  930. //
  931. format(Str, sizeof(Str), "O(a)administrador(a): %s Setou seu colete para: %d", pNomeOriginal[playerid], Numero);
  932. SendClientMessage(ID, CorSucesso, Str);
  933. //
  934. format(Str, 256, "AdmCmd: O administrador %s setou o colete de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  935. Log("pAdmin/Logs/SetarColete.ini", Str);
  936. return 1;
  937. }
  938.  
  939. CMD:lossantos(playerid, params[])
  940. {
  941. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  942. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  943. //
  944. SetPlayerPos(playerid, 1243.2844, -1693.2258, 16.1978);
  945. SetPlayerInterior(playerid, 0);
  946. SendClientMessage(playerid, CorSucesso, "Você foi até Los Santos");
  947. //
  948. format(Str, 56, "[AdmCmd] %s foi para LosSantos", pNomeOriginal[playerid]);
  949. Log("pAdmin/Logs/LosSantos.ini", Str);
  950. return 1;
  951. }
  952.  
  953. CMD:sanfierro(playerid, params[])
  954. {
  955. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  956. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  957. //
  958. SetPlayerPos(playerid, -1497.8163, 920.1724, 7.1875);
  959. SendClientMessage(playerid, CorSucesso, "Você foi até San Fierro");
  960. SetPlayerInterior(playerid, 0);
  961. //
  962. format(Str, 56, "[AdmCmd] %s foi para SanFierro", pNomeOriginal[playerid]);
  963. Log("pAdmin/Logs/SanFierro.ini", Str);
  964. return 1;
  965. }
  966.  
  967. CMD:lasventuras(playerid, params[])
  968. {
  969. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  970. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  971. //
  972. SetPlayerPos(playerid, 1015.0999755859, 1054.5999755859, 11);
  973. SendClientMessage(playerid, CorSucesso, "Você foi até Las Venturas");
  974. SetPlayerInterior(playerid, 0);
  975. //
  976. format(Str, 56, "[AdmCmd] %s foi para LasVenturas", pNomeOriginal[playerid]);
  977. Log("pAdmin/Logs/LasVenturas.ini", Str);
  978. return 1;
  979. }
  980.  
  981. CMD:criarcarro(playerid, params[])
  982. {
  983. new cor1, cor2;
  984. //
  985. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  986. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  987. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, CorErro, "Você não pode criar um carro estando dentro de um.");
  988. if(sscanf(params, "iii", Numero, cor1, cor2)) return SendClientMessage(playerid, CorErro, "USE: /criarcarro [ID] [COR1] [COR2]");
  989. if(Numero < 400 || Numero > 611) return SendClientMessage(playerid, CorErro, "USE IDS entre 400 e 611");
  990. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  991. if(GetPlayerInterior(playerid) != 0)
  992. {
  993. ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
  994. LinkVehicleToInterior(ID, GetPlayerInterior(playerid));
  995. }
  996. else
  997. {
  998. ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
  999. }
  1000. PutPlayerInVehicle(playerid, ID, 0);
  1001. FoiCriado[ID] = true;
  1002. return 1;
  1003. }
  1004.  
  1005. CMD:kick(playerid, params[])
  1006. {
  1007. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1008. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1009. if(sscanf(params, "ds[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /kick [ID] [MOTIVO]");
  1010. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1011. //
  1012. format(Str, sizeof(Str), "AdmCmd: O Player %s foi kickado pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
  1013. SendClientMessageToAll(VermelhoEscuro, Str);
  1014. Kick(ID);
  1015. //
  1016. Log("pAdmin/Logs/Kick.ini", Str);
  1017. return 1;
  1018. }
  1019.  
  1020. CMD:cadeia(playerid, params[])
  1021. {
  1022. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1023. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1024. if(sscanf(params, "iis[56]", ID, Numero, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /cadeia [ID] [TEMPO EM MINUTOS] [MOTIVO]");
  1025. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1026. //
  1027. if(Numero != 0)
  1028. {
  1029. PlayerInfo[ID][pCadeia] = Numero * 60;
  1030. SetPlayerPos(playerid, 322.197998,302.497985,999.148437);
  1031. SetPlayerInterior(playerid, 5);
  1032. SendClientMessage(playerid, VermelhoEscuro, "Você foi preso por um Administrador, irá cumrir pena na cadeia.");
  1033. }
  1034. else
  1035. {
  1036. PlayerInfo[ID][pCadeia] = 1;
  1037. }
  1038. //
  1039. format(Str, 256, "AdmCmd: O administrador %s prendeu %s por %i minutos. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Numero, Motivo);
  1040. SendClientMessageToAll(VermelhoEscuro, Str);
  1041. //
  1042. Log("pAdmin/Logs/Cadeia.ini", Str);
  1043. return 1;
  1044. }
  1045.  
  1046. CMD:tapa(playerid, params[])
  1047. {
  1048. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1049. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1050. if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tapa [ID]");
  1051. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1052. //
  1053. GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  1054. SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
  1055. //
  1056. format(Str, 256, "AdmCmd: Você deu um tapa em: %s", pNomeOriginal[ID]);
  1057. SendClientMessage(playerid, CorSucesso, Str);
  1058. format(Str, 256, "AdmCmd: O administrador %s deu um tapa em %s.", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1059. Log("pAdmin/Logs/Tapa.ini", Str);
  1060. return 1;
  1061. }
  1062.  
  1063. CMD:ir(playerid, params[])
  1064. {
  1065. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1066. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1067. if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /ir [ID]");
  1068. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1069. //
  1070. GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  1071. //
  1072. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  1073. {
  1074. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1075. }
  1076. else
  1077. {
  1078. SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  1079. }
  1080. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
  1081. SetPlayerInterior(playerid, GetPlayerInterior(ID));
  1082. //
  1083. format(Str, 256, "AdmCmd: O administrador %s foi até %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1084. Log("pAdmin/Logs/Ir.ini", Str);
  1085. return 1;
  1086. }
  1087.  
  1088. CMD:trazer(playerid, params[])
  1089. {
  1090. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1091. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1092. if(sscanf(params, "u", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /trazer [ID]");
  1093. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1094. //
  1095. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1096. //
  1097. if(GetPlayerState(ID) != PLAYER_STATE_DRIVER)
  1098. {
  1099. SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  1100. }
  1101. else
  1102. {
  1103. SetVehiclePos(GetPlayerVehicleID(ID), Pos[0], Pos[1], Pos[2]);
  1104. }
  1105. SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
  1106. SetPlayerInterior(ID, GetPlayerInterior(playerid));
  1107. //
  1108. format(Str, 256, "AdmCmd: O administrador %s trouxe %s até ele.", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1109. Log("pAdmin/Logs/Trazer.ini", Str);
  1110. return 1;
  1111. }
  1112.  
  1113. CMD:contagem(playerid, params[])
  1114. {
  1115. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1116. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1117. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /contagem [VALOR INICIAL]");
  1118. if(ID < 1 || ID > 20) return SendClientMessage(playerid, CorErro, "Use no maximo 20 segundos!");
  1119. if(ContagemIniciada == true)
  1120. {
  1121. SendClientMessage(playerid, CorErro, "Já existe uma contagem em andamento !");
  1122. }
  1123. else
  1124. {
  1125. format(Str, 256, "AdmCmd: O administrador: %s iniciou uma contagem de %i segundos.", pNomeOriginal[playerid], ID);
  1126. SendClientMessageToAll(CorSucesso, Str);
  1127. SetTimerEx("DiminuirTempo", 1000, false, "i", ID);
  1128. ContagemIniciada = true;
  1129. //
  1130. Log("pAdmin/Logs/Contagem.ini", Str);
  1131. }
  1132. return 1;
  1133. }
  1134.  
  1135. CMD:tv(playerid, params[])
  1136. {
  1137. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1138. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1139. if(IsAssistindo[playerid] == false)
  1140. {
  1141. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tv [ID]");
  1142. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1143. if(!IsPlayerInAnyVehicle(ID))
  1144. {
  1145. TogglePlayerSpectating(playerid, 1);
  1146. PlayerSpectatePlayer(playerid, ID);
  1147. }
  1148. else
  1149. {
  1150. TogglePlayerSpectating(playerid, 1);
  1151. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(ID));
  1152. }
  1153. SetPlayerInterior(playerid, GetPlayerInterior(ID));
  1154. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
  1155. Assistindo[playerid] = ID;
  1156. IsAssistindo[playerid] = true;
  1157. format(Str, 256, "O administrador %s ligou a TV em %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1158. Log("pAdmin/Logs/TV.ini", Str);
  1159. }
  1160. else
  1161. {
  1162. TogglePlayerSpectating(playerid, 0);
  1163. IsAssistindo[playerid] = false;
  1164. Assistindo[playerid] = -1;
  1165. format(Str, 256, "O administrador %s desligou a TV em %s", pNomeOriginal[playerid], pNomeOriginal[Assistindo[playerid]]);
  1166. Log("pAdmin/Logs/TV.ini", Str);
  1167. }
  1168. return 1;
  1169. }
  1170.  
  1171. CMD:dararma(playerid, params[])
  1172. {
  1173. new Municao, Arma;
  1174. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1175. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1176. if(sscanf(params, "iii", ID, Arma, Municao)) return SendClientMessage(playerid, CorErroNeutro, "USE: /dararma [ID] [ARMA] [MUNIÇÃO] | Para ver os IDs das armas, use: /idarmas");
  1177. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "[ERRO] ID invalido");
  1178. if(Arma<1 || Arma==19 || Arma==20||Arma==21||Arma>46) return SendClientMessage(playerid, CorErro, "ID da Arma Invalido, use de 1 a 46");
  1179. switch(Arma)
  1180. {
  1181. case 1: Motivo = "Soco Inglês";
  1182. case 2: Motivo = "Taco de Golf";
  1183. case 3: Motivo = "Cacetete";
  1184. case 4: Motivo = "Faca";
  1185. case 5: Motivo = "Taco de Baseball";
  1186. case 6: Motivo = "Pá";
  1187. case 7: Motivo = "Taco de Sinuca";
  1188. case 8: Motivo = "Katana";
  1189. case 9: Motivo = "Serra elétrica";
  1190. case 10: Motivo = "Pinto de Borracha";
  1191. case 11: Motivo = "Pinto roxo";
  1192. case 12: Motivo = "Vibrador";
  1193. case 13: Motivo = "Vibrador de Prata";
  1194. case 14: Motivo = "Flor";
  1195. case 15: Motivo = "Bengala";
  1196. case 16: Motivo = "Granada";
  1197. case 17: Motivo = "Bomba de gás";
  1198. case 18: Motivo = "Molotov";
  1199. case 22: Motivo = "Pistola 9mm";
  1200. case 23: Motivo = "Pistola com silenciador";
  1201. case 24: Motivo = "Desert Eagle";
  1202. case 25: Motivo = "ShotGun";
  1203. case 26: Motivo = "Sawnoff Shotgun";
  1204. case 27: Motivo = "Combat Shotgun";
  1205. case 28: Motivo = "Micro SMG";
  1206. case 29: Motivo = "MP5";
  1207. case 30: Motivo = "AK47";
  1208. case 31: Motivo = "M4";
  1209. case 32: Motivo = "Tec 9";
  1210. case 33: Motivo = "Country Rifle";
  1211. case 34: Motivo = "Sniper Rifle";
  1212. case 35: Motivo = "Bazooca RPG";
  1213. case 36: Motivo = "Bazooca Normal";
  1214. case 37: Motivo = "Lança Chamas";
  1215. case 38: Motivo = "Mini Gun";
  1216. case 39: Motivo = "C4";
  1217. case 40: Motivo = "Detonador";
  1218. case 41: Motivo = "Spray";
  1219. case 42: Motivo = "Extintor";
  1220. case 43: Motivo = "Oculos de visão noturna";
  1221. case 45: Motivo = "Oculos de visão de calor";
  1222. case 46: Motivo = "Paraquedas";
  1223. }
  1224. //
  1225. GivePlayerWeapon(ID, Arma, Municao);
  1226. //
  1227. format(Str, 256, "O Admin %s te deu um(a) %s com %d balas.", pNomeOriginal[playerid], Motivo, Municao);
  1228. SendClientMessage(ID, CorSucesso, Str);
  1229. //
  1230. format(Str, 256, "Você deu a %s te deu um(a) %s com %d balas.", pNomeOriginal[ID], Motivo, Municao);
  1231. SendClientMessage(playerid, CorSucesso, Str);
  1232. //
  1233. format(Str, 256, "AdmCmd: O administrador %s deu uma %s com %i balas para %s", pNomeOriginal[playerid], Motivo, Municao, pNomeOriginal[ID]);
  1234. Log("pAdmin/Logs/DarArma.ini", Str);
  1235. return 1;
  1236. }
  1237.  
  1238. CMD:idarmas(playerid)
  1239. {
  1240. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1241. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1242. SendClientMessage(playerid, Amarelo, "1 - Soco Inglês | 2 - Taco de Golf | 3 - Cacetete | 4 - Faca | 5 - Taco de Baseball");
  1243. SendClientMessage(playerid, Amarelo, "6 - Pá | 7 - Taco de Sinuca | 8 - Katana | 9 - Serra Elétrica | 10 - Pinto de Borracha");
  1244. SendClientMessage(playerid, Amarelo, "11 - Pinto roxo | 12 - Vibrador | 13 - Vibrador de Prata | 14 - Flor | 15 - Bengala");
  1245. SendClientMessage(playerid, Amarelo, "16 - Granada | 17 - Bomba de Gás | 18 - Molotov | 22 - Pistola 9mm | 23 - Silenciada");
  1246. SendClientMessage(playerid, Amarelo, "24 - Eagle | 25 - Shotgun | 26 - Sawoff | 27 - Combat Shotgun | 28 - Micro SMG");
  1247. SendClientMessage(playerid, Amarelo, "29 - MP5 | 30 - AK47 | 31 - M4 | 32 - Tec 9 | 33 - Country Rifle | 34 - Sniper Rifle");
  1248. SendClientMessage(playerid, Amarelo, "35 - Bazooca RPG | 36 - Bazooca | 37 - Lança Chamas | 38 - Minugun | 39 - C4");
  1249. SendClientMessage(playerid, Amarelo, "40 - Detonador | 41 - Spray | 42 - Extintor | 43 - Visão Noturna | 44 - Visão de Calor");
  1250. SendClientMessage(playerid, Amarelo, "46 - Paraquedas");
  1251. return 1;
  1252. }
  1253.  
  1254. CMD:desarmar(playerid, params[])
  1255. {
  1256. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1257. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1258. if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /desarmar [ID]");
  1259. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1260. ResetPlayerWeapons(ID);
  1261. //
  1262. format(Str, sizeof(Str), "Você desarmou: %s", pNomeOriginal[ID]);
  1263. SendClientMessage(ID, CorSucesso, Str);
  1264. //
  1265. format(Str, 106, "Você foi desarmado pelo administrador %s", pNomeOriginal[playerid]);
  1266. SendClientMessage(ID, CorSucesso, Str);
  1267. //
  1268. format(Str, 106, "AdmCmd: %s desarmou %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1269. Log("pAdmin/Logs/Desarmar.ini", Str);
  1270. return 1;
  1271. }
  1272.  
  1273. CMD:respawnvehs(playerid, params[])
  1274. {
  1275. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1276. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1277. for(new i = 0; i < MAX_VEHICLES; i++)
  1278. {
  1279. if(GetVehicleDriver(i))
  1280. {
  1281. if(FoiCriado[i] == true) DestroyVehicle(i);
  1282. else SetVehicleToRespawn(i);
  1283. }
  1284. }
  1285. format(Str, sizeof(Str), "O administrador %s deu Respawn em todos os veículos.", pNomeOriginal[playerid]);
  1286. SendClientMessageToAll(CorSucesso, Str);
  1287. //
  1288. Log("pAdmin/Logs/RespawnVehs.ini", Str);
  1289. return 1;
  1290. }
  1291.  
  1292. CMD:respawnveh(playerid, params[])
  1293. {
  1294. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1295. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1296. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /respawnveh [ID DO CARRO]");
  1297. {
  1298. if(GetVehicleDriver(ID))
  1299. {
  1300. if(FoiCriado[ID] == true) DestroyVehicle(ID), SendClientMessage(playerid, CorSucesso, "Este Veículo havia sido criado por um Administrador, portanto, foi destruído.");
  1301. else SetVehicleToRespawn(Numero), SendClientMessage(playerid, CorSucesso, "Você Respawnou o Veículo.");
  1302. }
  1303. else SendClientMessage(playerid, CorErro, "Este veículo está tripulado, portanto, você não pode respawna-lo !");
  1304. }
  1305. format(Str, 256, "%s Respawnou o veículo %i (Modelo: %s)", pNomeOriginal[playerid], Numero, GetVehicleModel(Numero));
  1306. //
  1307. Log("pAdmin/Logs/RespawnVeh.ini", Str);
  1308. return 1;
  1309. }
  1310.  
  1311. CMD:explodir(playerid, params[])
  1312. {
  1313. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1314. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1315. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /explodir [ID]");
  1316. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
  1317. //
  1318. GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
  1319. CreateExplosion(Pos[0], Pos[1], Pos[2], 1, 5);
  1320. //
  1321. format(Str, sizeof(Str), "Você colocou fogo em %s.", pNomeOriginal[ID]);
  1322. SendClientMessage(playerid, CorSucesso, Str);
  1323. //
  1324. format(Str, 106, "AdmCmd: %s explodiu %s", pNomeOriginal[ID], pNomeOriginal[playerid]);
  1325. Log("pAdmin/Logs/Explodir.ini", Str);
  1326. return 1;
  1327. }
  1328.  
  1329. CMD:banir(playerid, params[])
  1330. {
  1331. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1332. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1333. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /banir [ID] [MOTIVO]");
  1334. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
  1335. BanirPlayer(ID, playerid, Motivo);
  1336. return 1;
  1337. }
  1338.  
  1339. CMD:tempban(playerid,params[])
  1340. {
  1341. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
  1342. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1343. new Dias;
  1344. if(sscanf(params, "iis[56]", ID, Dias, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /tempban [ID] [TEMPO] [MOTIVO]");
  1345. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
  1346. if(Dias == 0) return SendClientMessage(playerid, CorErro, "Você não pode banir alguém por 0 dias.. USE: /banir para banimentos permanentes.");
  1347. if(Dias >= 360) return SendClientMessage(playerid, CorErro, "Você só pode banir alguém por no máximo 360 dias.");
  1348. //
  1349. new Data[24], Dia, Mes, Ano, Hora, Minuto;
  1350. gettime(Hora, Minuto);
  1351. getdate(Ano, Mes, Dia);
  1352. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  1353. format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[ID]);
  1354. DOF2_CreateFile(File);
  1355. DOF2_SetString(File, "Administrador", pNomeOriginal[playerid]);
  1356. DOF2_SetString(File, "Motivo", Motivo);
  1357. DOF2_SetString(File, "Data", Data);
  1358. Dia += Dias;
  1359. if(Mes == 1 || Mes == 3 || Mes == 5 || Mes == 7 || Mes == 8 || Mes == 10 || Mes == 12)
  1360. {
  1361. if(Dia > 31)
  1362. {
  1363. Dia -= 31;
  1364. Mes++;
  1365. if(Mes > 12) Mes = 1;
  1366. }
  1367. }
  1368. if(Mes == 4 || Mes == 6 || Mes == 9 || Mes == 11)
  1369. {
  1370. if(Dia > 30)
  1371. {
  1372. Dia -= 30;
  1373. Mes++;
  1374. }
  1375. }
  1376. if(Mes == 2)
  1377. {
  1378. if(Dia > 28)
  1379. {
  1380. Dia-=28;
  1381. Mes++;
  1382. }
  1383. }
  1384. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  1385. DOF2_SetString(File, "Desban", Data);
  1386. DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * Dias);
  1387. DOF2_SaveFile();
  1388. format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido por %i dias pelo administrador %s. Motivo: %s", pNomeOriginal[ID], Dias, pNomeOriginal[playerid], Motivo);
  1389. SendClientMessageToAll(VermelhoEscuro, Str);
  1390. Kick(ID);
  1391. return 1;
  1392. }
  1393.  
  1394. CMD:agendarban(playerid, params[])
  1395. {
  1396. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1397. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1398. new Nome[24], tempo;
  1399. if(sscanf(params, "s[24]is[56]", Nome, tempo, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /agendarban [CONTA] [TEMPO EM DIAS (999 = FOREVER)] [MOTIVO]");
  1400. format(File, sizeof(File), "pAdmin/Contas/%s.ini", Nome);
  1401. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Está conta não existe.");
  1402. format(Str, sizeof(Str), "Agendado - %s", Motivo);
  1403. AgendarBan(Nome, playerid, Str, tempo);
  1404. format(Str, sizeof(Str), "AdmCmd: O Administrador %s agendou %s para ser banido. Motivo: %s", pNomeOriginal[playerid], Nome, Motivo);
  1405. SendClientMessageToAll(VermelhoEscuro, Str);
  1406. Log("pAdmin/Logs/AgendarBan.ini", Str);
  1407. SendClientMessage(playerid, Amarelo, "DICA: Para cancelar um agendamento peça para um Master usar o /desbanir.");
  1408. return 1;
  1409. }
  1410.  
  1411. CMD:agendarcadeia(playerid, params[])
  1412. {
  1413. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1414. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1415. new Nome[24];
  1416. if(sscanf(params, "s[24]is[56]", Nome, ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /agendarcadeia [CONTA] [TEMPO EM MINUTOS] [MOTIVO]");
  1417. new ID1 = GetPlayerID(Nome);
  1418. if(IsPlayerConnected(ID1)) return SendClientMessage(playerid, CorErro, "Este jogador está Online, use /cadeia.");
  1419. format(File, sizeof(File), "pAdmin/Contas/%s.ini", Nome);
  1420. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Está conta não existe.");
  1421. format(Str, sizeof(Str), "AdmCmd: O Administrador %s agendou %s para %i minutos de cadeia. Motivo: %s", pNomeOriginal[playerid], Nome, ID, Motivo);
  1422. SendClientMessageToAll(VermelhoEscuro, Str);
  1423. AgendarCadeia(Nome, ID, playerid, Motivo);
  1424. if(ID > 0) SendClientMessage(playerid, Amarelo, "DICA: Para cancelar um agendamento de cadeia use valores negativos no Tempo.");
  1425. return 1;
  1426. }
  1427.  
  1428. CMD:ircarro(playerid, params[])
  1429. {
  1430. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1431. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1432. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /ircarro [CARRO ID]");
  1433. if(ID == INVALID_VEHICLE_ID) return SendClientMessage(playerid, CorErro, "ID InválidO");
  1434. GetVehiclePos(ID, Pos[0], Pos[1], Pos[2]);
  1435. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1436. return 1;
  1437. }
  1438.  
  1439. /* Comandos para administrador Level 2 */
  1440.  
  1441. CMD:aviso(playerid, params[]) // /cadeia - /ban - /aviso
  1442. {
  1443. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1444. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1445. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /aviso [ID] [MOTIVO]");
  1446. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
  1447. //
  1448. PlayerInfo[ID][pAvisos]++;
  1449. if(PlayerInfo[playerid][pAvisos] != 3)
  1450. {
  1451. format(Str, sizeof(Str), "AdmCmd: O Player %s recebeu um aviso do administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
  1452. SendClientMessageToAll(VermelhoEscuro, Str);
  1453. Log("pAdmin/Logs/Aviso.ini", Str);
  1454. Kick(ID);
  1455. }
  1456. else
  1457. {
  1458. format(Str, sizeof(Str), "AdmCmd: O Player %s recebeu um aviso do administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
  1459. SendClientMessageToAll(VermelhoEscuro, Str);
  1460. Log("pAdmin/Logs/Aviso.ini", Str);
  1461. BanirPlayer(ID, playerid, "Ultrapassou o limite de avisos");
  1462. }
  1463. return 1;
  1464. }
  1465.  
  1466. CMD:banirip(playerid, params[])
  1467. {
  1468. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1469. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1470. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /banirip [ID] [MOTIVO]");
  1471. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
  1472. BanirIP(ID, playerid, Motivo);
  1473. return 1;
  1474. }
  1475.  
  1476. CMD:jogar(playerid, params[])
  1477. {
  1478. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
  1479. if(pJogando[playerid] == false)
  1480. {
  1481. pJogando[playerid] = true;
  1482. SendClientMessage(playerid, CorSucesso, "Você está jogando. Agora você é um Player Comum. Para voltar a administração use /jogar.");
  1483. }
  1484. else
  1485. {
  1486. pJogando[playerid] = false;
  1487. SendClientMessage(playerid, CorSucesso, "Você está trabalhando. Agora você é um administrador. Para voltar a jogar use /jogar.");
  1488. }
  1489. return 1;
  1490. }
  1491.  
  1492. CMD:calar(playerid, params[])
  1493. {
  1494. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
  1495. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1496. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /calar [ID] [MOTIVO]");
  1497. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1498. //
  1499. PlayerInfo[ID][pCalado] = true;
  1500. //
  1501. format(Str, sizeof(Str), "AdmCmd: O administrador %s calou %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Motivo);
  1502. SendClientMessageToAll(VermelhoEscuro, Str);
  1503. //
  1504. Log("pAdmin/Logs/Calar.ini", Str);
  1505. return 1;
  1506. }
  1507.  
  1508. CMD:descalar(playerid, params[])
  1509. {
  1510. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
  1511. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1512. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /descalar [ID]");
  1513. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1514. //
  1515. PlayerInfo[ID][pCalado] = false;
  1516. //
  1517. format(Str, sizeof(Str), "AdmCmd: O administrador %s habilitou o chat de %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1518. SendClientMessageToAll(VermelhoEscuro, Str);
  1519. //
  1520. Log("pAdmin/Logs/Descalar.ini", Str);
  1521. return 1;
  1522. }
  1523.  
  1524. CMD:limparchat(playerid, params[])
  1525. {
  1526. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
  1527. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1528. for(new i = 0; i < 300; i++)
  1529. {
  1530. SendClientMessageToAll(-1, " ");
  1531. }
  1532. format(Str, 256, "AdmCmd: {00FF00}Chat Limpo com Sucesso por: {9400D3}%s", pNomeOriginal[playerid]);
  1533. SendClientMessageToAll(VermelhoEscuro, Str);
  1534. //
  1535. format(Str, 256, "AdmCmd: O administrador %s limpou o chat", pNomeOriginal[playerid]);
  1536. Log("pAdmin/Logs/LimparChat.ini", Str);
  1537. return 1;
  1538. }
  1539.  
  1540. /* Comandos para administrador Level 3 */
  1541.  
  1542. CMD:ejetar(playerid, params[])
  1543. {
  1544. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
  1545. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1546. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /ejetar [ID]");
  1547. RemovePlayerFromVehicle(ID);
  1548. return 1;
  1549. }
  1550.  
  1551. CMD:destroyveh(playerid, params[])
  1552. {
  1553. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
  1554. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1555. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /destroyveh [ID DO CARRO]");
  1556. {
  1557. if(GetVehicleDriver(ID))
  1558. {
  1559. DestroyVehicle(ID);
  1560. SendClientMessage(playerid, CorSucesso, "Você destruiu o Veículo.");
  1561. }
  1562. else
  1563. {
  1564. SendClientMessage(playerid, CorErro, "Este veículo está tripulado, portanto, você não pode destruí-lo ! Use /ejetar [ID]");
  1565. }
  1566. }
  1567. return 1;
  1568. }
  1569.  
  1570. CMD:congelar(playerid, params[])
  1571. {
  1572. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
  1573. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1574. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /congelar [ID]");
  1575. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1576. //
  1577. TogglePlayerControllable(ID, false);
  1578. PlayerInfo[playerid][pCongelado] = true;
  1579. SetPlayerHealth(ID, 99999);
  1580. SendClientMessage(playerid, CorSucesso, "Você congelou o Player");
  1581. //
  1582. format(Str, sizeof(Str), "O administrador %s congelou: %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1583. Log("pAdmin/Logs/Congelar.ini", Str);
  1584. return 1;
  1585. }
  1586.  
  1587. CMD:descongelar(playerid, params[])
  1588. {
  1589. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
  1590. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1591. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /descongelar [ID]");
  1592. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1593. //
  1594. SetPlayerHealth(ID, 100);
  1595. TogglePlayerControllable(ID, true);
  1596. PlayerInfo[playerid][pCongelado] = false;
  1597. SendClientMessage(playerid, CorSucesso, "Você descongelou o Player.");
  1598. //
  1599. format(Str, sizeof(Str), "O administrador %s descongelou %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
  1600. Log("pAdmin/Logs/Descongelar.ini", Str);
  1601. return 1;
  1602. }
  1603.  
  1604. /* Comandos para administrador Level 4 */
  1605.  
  1606. CMD:setarmundo(playerid, params[])
  1607. {
  1608. if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 4 para usar este comando");
  1609. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1610. if(sscanf(params, "id", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarmundo [ID] [WORLD ID]");
  1611. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1612. //
  1613. SetPlayerVirtualWorld(ID, Numero);
  1614. //
  1615. format(Str, sizeof(Str), "Você setou o mundo virtual de %s para %d", ID, Numero);
  1616. SendClientMessage(playerid, CorSucesso, Str);
  1617. //
  1618. format(Str, sizeof(Str), "O administrador %s setou seu mundo virtual para %d", pNomeOriginal[playerid], Numero);
  1619. SendClientMessage(ID, CorSucesso, Str);
  1620. //
  1621. format(Str, 106, "AdmCmd: %s setou o Virtual World de %s para %i", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  1622. Log("pAdmin/Logs/SetarMundo.ini", Str);
  1623. return 1;
  1624. }
  1625.  
  1626. CMD:aa4(playerid, params[])
  1627. {
  1628. if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 4 para usar este comando");
  1629. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1630. //
  1631. SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
  1632. SendClientMessage(playerid, Amarelo, "Administrador Level 4:");
  1633. SendClientMessage(playerid, CinzaClaro, "/setarmundo - /aa4");
  1634. SendClientMessage(playerid, Amarelo, "Administrador Level 5 (MASTER):");
  1635. SendClientMessage(playerid, CinzaClaro, "/chat - /desbanir - /desbanirip - /disfarce - /congelartodos");
  1636. SendClientMessage(playerid, CinzaClaro, "/descongelartodos - /dardinheiro - /setardinheiro - /setarscore");
  1637. SendClientMessage(playerid, CinzaClaro, "/clima - /vidatodos - /coletetodos - /armatodos - /esconder");
  1638. SendClientMessage(playerid, CinzaClaro, "/fakekick - /fakeban");
  1639. SendClientMessage(playerid, Amarelo, "Administrador Level 6 (MÁXIMO):");
  1640. SendClientMessage(playerid, CinzaClaro, "/daradmin - /tiraradmin");
  1641. SendClientMessage(playerid, Amarelo, "Administrador Level 7 (DONO):");
  1642. SendClientMessage(playerid, CinzaClaro, "/gmx - /senhaserver -/antiafk");
  1643. SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
  1644. //
  1645. return 1;
  1646. }
  1647.  
  1648. /* MASTER */
  1649.  
  1650. CMD:chat(playerid)
  1651. {
  1652. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
  1653. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1654. if(ChatLigado == true)
  1655. {
  1656. SendClientMessage(playerid, Amarelo, "Você desativou o Chat para todos os jogadores.");
  1657. ChatLigado = false;
  1658. format(Str, 256, "O Administrador %s desabilitou o Chat para todos os jogadores.", pNomeOriginal[playerid]);
  1659. }
  1660. else
  1661. {
  1662. SendClientMessage(playerid, Amarelo, "Você ativou o Chat para todos os jogadores.");
  1663. ChatLigado = true;
  1664. format(Str, 256, "O Administrador %s habilitou o Chat para todos os jogadores.", pNomeOriginal[playerid]);
  1665. }
  1666. SendClientMessageToAll(AzulRoyal, Str);
  1667. return 1;
  1668. }
  1669.  
  1670. CMD:desbanir(playerid, params[])
  1671. {
  1672. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
  1673. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1674. if(sscanf(params, "s[24]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /desbanir [Conta - Nome_Sobrenome (COMPLETO)]");
  1675. format(File, sizeof(File), "pAdmin/Contas/%s.ini", Motivo);
  1676. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Esta conta não foi encontrada em nosso banco de dados.");
  1677. format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", Motivo);
  1678. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Esta conta não está banida.");
  1679. new File1[48];
  1680. format(File1, 48, "pAdmin/Backups/Banidos/%s.ini", Motivo);
  1681. DOF2_CopyFile(File, File1);
  1682. DOF2_RemoveFile(File);
  1683. //
  1684. format(Str, sizeof(Str), "AdmCmd: O Player %s foi desbanido pelo administrador %s.", Motivo, pNomeOriginal[playerid]);
  1685. SendClientMessageToAll(VermelhoEscuro, Str);
  1686. Log("pAdmin/Logs/Desbanir.ini", Str);
  1687. return 1;
  1688. }
  1689.  
  1690. CMD:desbanirip(playerid, params[])
  1691. {
  1692. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
  1693. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1694. if(sscanf(params, "s[24]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /desbanirip [IP]");
  1695. format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", Motivo);
  1696. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Este IP não está banido.");
  1697. new File1[48];
  1698. format(File1, 48, "pAdmin/Backups/IPs Banidos/%s.ini", Motivo);
  1699. DOF2_CopyFile(File, File1);
  1700. DOF2_RemoveFile(File);
  1701. //
  1702. SendClientMessage(playerid, Amarelo, "O IP foi desbanido com sucesso.");
  1703. format(Str, sizeof(Str), "AdmCmd: O IP %s foi desbanido pelo administrador %s.", Motivo);
  1704. Log("pAdmin/Logs/DesbanirIP.ini", Str);
  1705. return 1;
  1706. }
  1707.  
  1708. CMD:disfarce(playerid, params[])
  1709. {
  1710. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
  1711. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1712. GetPlayerName(playerid, Motivo, 56);
  1713. if(strcmp(pNomeOriginal[playerid], Motivo))
  1714. {
  1715. AparecendoNoAdmins[playerid] = true;
  1716. SetPlayerName(playerid, pNomeOriginal[playerid]);
  1717. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  1718. SetPlayerColor(playerid, 0xDDA0DDFF);
  1719. SendClientMessage(playerid, CorSucesso, "Você saiu do disfarce com sucesso");
  1720. //
  1721. format(Str, 106, "AdmCmd: %s saiu do disfarce", pNomeOriginal[playerid]);
  1722. Log("pAdmin/Logs/Disfarce.ini", Str);
  1723. }
  1724. else
  1725. {
  1726. AparecendoNoAdmins[playerid] = false;
  1727. if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /disfarce [NOME]");
  1728. SetPlayerName(playerid, Motivo);
  1729. SetPlayerColor(playerid, 0xD3D3D3FF);
  1730. SendClientMessage(playerid, CorSucesso, "Você se disfarçou com sucesso");
  1731. format(Str, 106, "AdmCmd: %s se disfarçou com o nome de %s", pNomeOriginal[playerid], Motivo);
  1732. Log("pAdmin/Logs/Disfarce.ini", Str);
  1733. }
  1734. return 1;
  1735. }
  1736.  
  1737. CMD:congelartodos(playerid, params[])
  1738. {
  1739. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1740. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1741. for(new i = 0; i < MAX_PLAYERS; i++)
  1742. {
  1743. TogglePlayerControllable(i, false);
  1744. PlayerInfo[playerid][pCongelado] = true;
  1745. }
  1746. format(Str, sizeof(Str), "O administrador %s congelou todos os Jogadores", pNomeOriginal[playerid]);
  1747. SendClientMessageToAll(CorSucesso, Str);
  1748. //
  1749. Log("pAdmin/Logs/CongelarTodos.ini", Str);
  1750. return 1;
  1751. }
  1752.  
  1753. CMD:descongelartodos(playerid, params[])
  1754. {
  1755. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1756. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1757. for(new i = 0; i < MAX_PLAYERS; i++)
  1758. {
  1759. TogglePlayerControllable(i, true);
  1760. PlayerInfo[playerid][pCongelado] = false;
  1761. }
  1762. format(Str, sizeof(Str), "O administrador %s descongelou todos os Jogadores", pNomeOriginal[playerid]);
  1763. SendClientMessageToAll(CorSucesso, Str);
  1764. //
  1765. Log("pAdmin/Logs/DescongelarTodos.ini", Str);
  1766. return 1;
  1767. }
  1768.  
  1769. CMD:dardinheiro(playerid, params[])
  1770. {
  1771. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1772. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1773. if(Numero < 0 || Numero > 10000000) return SendClientMessage(playerid, CorErro, "O valor deve estar entre 0 e 10.000.000 (10kk)");
  1774. if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /dardinheiro [ID] [QUANTIA]");
  1775. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1776. //
  1777. GivePlayerMoney(ID, Numero);
  1778. format(Str, 256, "Você deu a %s %d de dinheiro.", pNomeOriginal[ID], Numero);
  1779. SendClientMessage(playerid, CorSucesso, Str);
  1780. //
  1781. format(Str, sizeof(Str), "O administrador %s lhe deu %d de dinheiro.", pNomeOriginal[playerid], Numero);
  1782. SendClientMessage(ID, CorSucesso, Str);
  1783. //
  1784. format(Str, 256, "AdmCmd: O administrador %s deu %d de dinheiro para %s", pNomeOriginal[playerid], Numero, pNomeOriginal[ID]);
  1785. Log("pAdmin/Logs/DarDinheiro.ini", Str);
  1786. return 1;
  1787. }
  1788.  
  1789. CMD:setardinheiro(playerid, params[])
  1790. {
  1791. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1792. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1793. new Tanto;
  1794. if(sscanf(params, "dd", ID, Tanto)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setardinheiro [ID] [QUANTIA]");
  1795. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1796. //
  1797. SetPlayerMoney(ID, Tanto);
  1798. //
  1799. format(Str, 256, "Você setou o dinheiro de %s para: %d", pNomeOriginal[ID], Tanto);
  1800. SendClientMessage(playerid, CorSucesso, Str);
  1801. format(Str, sizeof(Str), "O administrador %s setou seu dinheiro para: %d", pNomeOriginal[playerid], Tanto);
  1802. SendClientMessage(ID, CorSucesso, Str);
  1803. //
  1804. format(Str, 256, "AdmCmd: O administrador %s setou o dinheiro de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Tanto);
  1805. Log("pAdmin/Logs/SetarDinheiro.ini", Str);
  1806. return 1;
  1807. }
  1808.  
  1809. CMD:setarscore(playerid, params[])
  1810. {
  1811. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1812. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1813. if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarscore [ID] [SCORE]");
  1814. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1815. //
  1816. SetPlayerScore(ID, Numero);
  1817. //
  1818. format(Str, sizeof(Str), "Você setou o nível de %s para: %d", pNomeOriginal[ID], Numero);
  1819. SendClientMessage(playerid, CorSucesso, Str);
  1820. //
  1821. format(Str, sizeof(Str), "O administrador %s setou seu nível para: %d", pNomeOriginal[playerid], Numero);
  1822. SendClientMessage(playerid, CorSucesso, Str);
  1823. //
  1824. format(Str, 256, "AdmCmd: O administrador %s setou o level de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  1825. Log("pAdmin/Logs/SetarScore.ini", Str);
  1826. return 1;
  1827. }
  1828.  
  1829. CMD:clima(playerid, params[])
  1830. {
  1831. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1832. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1833. if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /clima [ID DO CLIMA]");
  1834. if(ID < 1 || ID > 19) return SendClientMessage(playerid, CorErro, "Use somente IDs entre 1 em 19.");
  1835. //
  1836. SetWeather(ID);
  1837. format(Str, 256, "AdmCmd: O administrador %s alterou o Clima para o ID %d.", pNomeOriginal[playerid], ID);
  1838. SendClientMessageToAll(CorSucesso, Str);
  1839. //
  1840. Log("pAdmin/Logs/Clima.ini", Str);
  1841. return 1;
  1842. }
  1843.  
  1844. CMD:vidatodos(playerid, params[])
  1845. {
  1846. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1847. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1848. for(new i=0; i<MAX_PLAYERS; i++)
  1849. {
  1850. SetPlayerHealth(i, 100);
  1851. }
  1852. format(Str, 256, "AdmCmd: O administrador %s encheu a vida de todos os jogadores conectados.", pNomeOriginal[playerid]);
  1853. SendClientMessageToAll(CorSucesso, Str);
  1854. //
  1855. Log("pAdmin/Logs/VidaTodos.ini", Str);
  1856. return 1;
  1857. }
  1858.  
  1859. CMD:coletetodos(playerid, params[])
  1860. {
  1861. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1862. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1863. for(new i=0; i<MAX_PLAYERS; i++)
  1864. {
  1865. SetPlayerArmour(i, 100);
  1866. }
  1867. format(Str, 256, "AdmCmd: O administrador %s encheu o colete de todos os jogadores conectados.", pNomeOriginal[playerid]);
  1868. SendClientMessageToAll(CorSucesso, Str);
  1869. //
  1870. Log("pAdmin/Logs/ColeteTodos.ini", Str);
  1871. return 1;
  1872. }
  1873.  
  1874. CMD:armatodos(playerid, params[])
  1875. {
  1876. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1877. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1878. if(sscanf(params, "ii", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /armatodos [ARMA ID] [MUNIÇAO] | Para ver os IDs das armas, use: /idarmas");
  1879. if(ID < 1 || ID == 19 || ID == 20 || ID == 21 || ID > 46) return SendClientMessage(playerid, CorErro, "ID da Arma Invalido, use de 1 a 46");
  1880. for(new i=0; i <MAX_PLAYERS; i++)
  1881. {
  1882. GivePlayerWeapon(i, ID, Numero);
  1883. }
  1884. switch(ID)
  1885. {
  1886. case 1: Motivo = "Soco Inglês";
  1887. case 2: Motivo = "Taco de Golf";
  1888. case 3: Motivo = "Cacetete";
  1889. case 4: Motivo = "Faca";
  1890. case 5: Motivo = "Taco de Baseball";
  1891. case 6: Motivo = "Pá";
  1892. case 7: Motivo = "Taco de Sinuca";
  1893. case 8: Motivo = "Kitana";
  1894. case 9: Motivo = "Serra elétrica";
  1895. case 10: Motivo = "Pinto de Borracha";
  1896. case 11: Motivo = "Pinto roxo";
  1897. case 12: Motivo = "Vibrador";
  1898. case 13: Motivo = "Vibrador de Prata";
  1899. case 14: Motivo = "Flor";
  1900. case 15: Motivo = "Bengala";
  1901. case 16: Motivo = "Granada";
  1902. case 17: Motivo = "Bomba de gás";
  1903. case 18: Motivo = "Molotov";
  1904. case 22: Motivo = "Pistola 9mm";
  1905. case 23: Motivo = "Pistola com silenciador";
  1906. case 24: Motivo = "Desert Eagle";
  1907. case 25: Motivo = "ShotGun";
  1908. case 26: Motivo = "Sawnoff Shotgun";
  1909. case 27: Motivo = "Combat Shotgun";
  1910. case 28: Motivo = "Micro SMG";
  1911. case 29: Motivo = "MP5";
  1912. case 30: Motivo = "AK47";
  1913. case 31: Motivo = "M4";
  1914. case 32: Motivo = "Tec 9";
  1915. case 33: Motivo = "Country Rifle";
  1916. case 34: Motivo = "Sniper Rifle";
  1917. case 35: Motivo = "Bazooca RPG";
  1918. case 36: Motivo = "Bazooca Normal";
  1919. case 37: Motivo = "Lança Chamas";
  1920. case 38: Motivo = "Mini Gun";
  1921. case 39: Motivo = "C4";
  1922. case 40: Motivo = "Detonador";
  1923. case 41: Motivo = "Spray";
  1924. case 42: Motivo = "Extintor";
  1925. case 43: Motivo = "Oculos de visão noturna";
  1926. case 45: Motivo = "Oculos de visão de calor";
  1927. case 46: Motivo = "Paraquedas";
  1928. }
  1929. format(Str, 256, "AdmCmd: O administrador %s deu uma %s com %d balas para todos os jogadores conectados.", pNomeOriginal[playerid], Motivo, Numero);
  1930. SendClientMessageToAll(CorSucesso, Str);
  1931. //
  1932. Log("pAdmin/Logs/ArmaTodos.ini", Str);
  1933. return 1;
  1934. }
  1935.  
  1936. CMD:esconder(playerid)
  1937. {
  1938. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1939. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1940. //
  1941. new bool:Trocou = false;
  1942. if(AparecendoNoAdmins[playerid] == true)
  1943. {
  1944. Trocou = true;
  1945. AparecendoNoAdmins[playerid] = false;
  1946. SendClientMessage(playerid, CorSucesso, "Você está escondido e não aparecerá no /admins");
  1947. }
  1948. if(AparecendoNoAdmins[playerid] == false && Trocou == false)
  1949. {
  1950. AparecendoNoAdmins[playerid] = true;
  1951. SendClientMessage(playerid, CorSucesso, "Você não está mais escondido e aparecerá no /admins");
  1952. }
  1953. return 1;
  1954. }
  1955.  
  1956. CMD:fakekick(playerid, params[])
  1957. {
  1958. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1959. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1960. if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /fakekick [ID] [MOTIVO]");
  1961. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1962. //
  1963. format(Str, 256, "AdmCmd: O Player %s foi kickado pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
  1964. SendClientMessageToAll(VermelhoEscuro, Str);
  1965. //
  1966. format(Str, 256, "AdmCmd: O administrador %s fingiu ter kickado %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[playerid], Motivo);
  1967. Log("pAdmin/Logs/FakeKick.ini", Str);
  1968. return 1;
  1969. }
  1970.  
  1971. CMD:fakeban(playerid, params[])
  1972. {
  1973. if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
  1974. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1975. if(sscanf(params, "us[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /fakeban [ID] [MOTIVO]");
  1976. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1977. //
  1978. format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
  1979. SendClientMessageToAll(VermelhoEscuro, Str);
  1980. //
  1981. format(Str, 256, "AdmCmd: O administrador %s fingiu ter banido %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Motivo);
  1982. Log("pAdmin/Logs/FakeBan.ini", Str);
  1983. return 1;
  1984. }
  1985.  
  1986. /* Administrador Level 6 */
  1987.  
  1988.  
  1989. CMD:daradmin(playerid, params[])
  1990. {
  1991. if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MÁXIMO para usar este comando");
  1992. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  1993. if(sscanf(params, "ii", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /daradmin [ID] [LEVEL]");
  1994. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  1995. if(Numero > 6 || Numero == 0) return SendClientMessage(playerid, Vermelho, "ERRO: O Level deve esstar entre 1 e 6 !");
  1996. format(Str, 256, "Você definiu o level de administração de %s para %i.", pNomeOriginal[ID], Numero);
  1997. SendClientMessage(playerid, Azul, Str);
  1998. //
  1999. format(Str, 256, "Você foi promovido a Level %i de administração. Você foi promovido por %s.", Numero, pNomeOriginal[playerid]);
  2000. SendClientMessage(ID, Azul, Str);
  2001. //
  2002. format(Str, sizeof(Str), "AdmCmd: O administrador %s definiu o nível de administração de %s para %i.", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
  2003. PlayerInfo[ID][pAdmin] = Numero;
  2004. //
  2005. Log("pAdmin/Logs/DarAdmin.ini", Str);
  2006. return 1;
  2007. }
  2008.  
  2009. CMD:tiraradmin(playerid, params[])
  2010. {
  2011. new MotivoM[256];
  2012. if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MÁXIMO para usar este comando");
  2013. if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
  2014. if(sscanf(params, "ds[256]", ID, MotivoM)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tiraradmin [ID] [MOTIVO]");
  2015. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
  2016. //
  2017. format(Str, 256, "Você retirou %s da administração", pNomeOriginal[ID]);
  2018. SendClientMessage(playerid, Azul, Str);
  2019. //
  2020. format(Str, 256, "Você foi retirado da administração por %s. Motivo: %s", pNomeOriginal[playerid], MotivoM);
  2021. SendClientMessage(ID, Azul, Str);
  2022. //
  2023. format(Str, sizeof(Str), "AdmCmd: O administrador %s definiu o nível de administração de %s para 0. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], MotivoM);
  2024. PlayerInfo[ID][pAdmin] = 0;
  2025. //
  2026. Log("pAdmin/Logs/TirarAdmin.ini", Str);
  2027. return 1;
  2028. }
  2029.  
  2030. /* Administrador Dono */
  2031. #if UsarPedAnims == 1
  2032. CMD:antiafk(playerid)
  2033. {
  2034. if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
  2035. if(AntiAFK_Ativado)
  2036. {
  2037. AntiAFK_Ativado = false;
  2038. SendClientMessage(playerid, CorSucesso, "Anti-AFK desativado.");
  2039. }
  2040. else
  2041. {
  2042. AntiAFK_Ativado = true;
  2043. SendClientMessage(playerid, CorSucesso, "Anti-AFK ativado.");
  2044. }
  2045. return 1;
  2046. }
  2047. #endif
  2048. CMD:gmx(playerid)
  2049. {
  2050. if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
  2051. for(new i; i < MAX_PLAYERS; i++)
  2052. {
  2053. if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i);
  2054. format(Str, 256, "Atenção: Um GMX foi executado por %s. O Servidor voltará em poucos segundos.", pNomeOriginal[playerid]);
  2055. SendClientMessage(playerid, Amarelo, Str);
  2056. }
  2057. SendRconCommand("gmx");
  2058. return 1;
  2059. }
  2060.  
  2061. CMD:senhaserver(playerid, params[])
  2062. {
  2063. if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
  2064. if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /senhaserver [SENHA] | 0 = SEM SENHA");
  2065. SendRconCommand(Motivo);
  2066. SendClientMessageToAll(Amarelo, "O Servidor foi trancado.");
  2067. return 1;
  2068. }
  2069.  
  2070. /* STOCKs */
  2071.  
  2072. stock GetPlayerID(Nome[])
  2073. {
  2074. for(new i; i < MAX_PLAYERS; i++)
  2075. {
  2076. if(IsPlayerConnected(i))
  2077. {
  2078. if(!strcmp(pNomeOriginal[i], Nome, true, 24)) return i;
  2079. }
  2080. }
  2081. return -1;
  2082. }
  2083.  
  2084. stock BanirPlayer(playerid, administrador, Motivo1[])
  2085. {
  2086. new Data[24], Dia, Mes, Ano, Hora, Minuto;
  2087. gettime(Hora, Minuto);
  2088. getdate(Ano, Mes, Dia);
  2089. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  2090. format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[playerid]);
  2091. DOF2_CreateFile(File);
  2092. DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
  2093. DOF2_SetString(File, "Motivo", Motivo1);
  2094. DOF2_SetString(File, "Data", Data);
  2095. DOF2_SetString(File, "Desban", "Nunca");
  2096. DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * 999);
  2097. DOF2_SaveFile();
  2098. format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[administrador], Motivo1);
  2099. SendClientMessageToAll(VermelhoEscuro, Str);
  2100. Log("pAdmin/Logs/Banir.ini", Str);
  2101. Kick(playerid);
  2102. return 1;
  2103. }
  2104.  
  2105. stock AgendarBan(playerid[], administrador, Motivo1[], Dias)
  2106. {
  2107. new Data[24], Dia, Mes, Ano, Hora, Minuto;
  2108. gettime(Hora, Minuto);
  2109. getdate(Ano, Mes, Dia);
  2110. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  2111. format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", playerid);
  2112. DOF2_CreateFile(File);
  2113. DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
  2114. DOF2_SetString(File, "Motivo", Motivo1);
  2115. DOF2_SetString(File, "Data", Data);
  2116. if(Dias == 999)
  2117. {
  2118. DOF2_SetString(File, "Desban", "Nunca");
  2119. DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * 999); // 999 DIAS
  2120. }
  2121. else
  2122. {
  2123. getdate(Ano, Mes, Dia);
  2124. Dia += Dias;
  2125. if(Mes == 1 || Mes == 3 || Mes == 5 || Mes == 7 || Mes == 8 || Mes == 10 || Mes == 12)
  2126. {
  2127. if(Dia > 31)
  2128. {
  2129. Dia -= 31;
  2130. Mes++;
  2131. if(Mes > 12) Mes = 1;
  2132. }
  2133. }
  2134. if(Mes == 4 || Mes == 6 || Mes == 9 || Mes == 11)
  2135. {
  2136. if(Dia > 30)
  2137. {
  2138. Dia -= 30;
  2139. Mes++;
  2140. }
  2141. }
  2142. if(Mes == 2)
  2143. {
  2144. if(Dia > 28)
  2145. {
  2146. Dia-=28;
  2147. Mes++;
  2148. }
  2149. }
  2150. gettime(Hora, Minuto);
  2151. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  2152. //
  2153. DOF2_SetString(File, "Desban", Data);
  2154. DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * Dias);
  2155. }
  2156. DOF2_SaveFile();
  2157. return 1;
  2158. }
  2159.  
  2160. stock AgendarCadeia(playerid[], tempo, administrador, Motivo1[])
  2161. {
  2162. if(tempo < 0)
  2163. {
  2164. format(File, 56, "pAdmin/Contas/%s.ini", playerid);
  2165. new TempoAtual = DOF2_GetInt(File, "pCadeia");
  2166. if(tempo * -1 >= TempoAtual / 60)
  2167. {
  2168. DOF2_SetInt(File, "pCadeia", 0);
  2169. DOF2_SaveFile();
  2170. format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
  2171. if(DOF2_FileExists(File)) DOF2_RemoveFile(File);
  2172. return 0;
  2173. }
  2174. else
  2175. {
  2176. new tempo1 = tempo * -1 * 60;
  2177. TempoAtual -= tempo1;
  2178. DOF2_SetInt(File, "pCadeia", TempoAtual);
  2179. DOF2_SaveFile();
  2180. format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
  2181. if(DOF2_FileExists(File)) DOF2_SetInt(File, "Tempo", DOF2_GetInt(File, "Tempo") - tempo * -1), DOF2_SaveFile();
  2182. return 0;
  2183. }
  2184. }
  2185. if(tempo > 0)
  2186. {
  2187. format(File, 56, "pAdmin/Contas/%s.ini", playerid);
  2188. if(DOF2_GetInt(File, "pCadeia") > 0)
  2189. {
  2190. new Tempo9;
  2191. Tempo9 = tempo * 60;
  2192. DOF2_SetInt(File, "pCadeia", DOF2_GetInt(File, "pCadeia") + Tempo9);
  2193. DOF2_SaveFile();
  2194. }
  2195. else
  2196. {
  2197. DOF2_SetInt(File, "pCadeia", tempo * 60);
  2198. DOF2_SaveFile();
  2199. }
  2200. format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
  2201. if(!DOF2_FileExists(File))
  2202. {
  2203. DOF2_CreateFile(File);
  2204. DOF2_SetInt(File, "Tempo", tempo);
  2205. DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
  2206. DOF2_SetString(File, "Motivo", Motivo1);
  2207. DOF2_SaveFile();
  2208. }
  2209. else
  2210. {
  2211. new ADM[24], Motivo2[56], Tempo1;
  2212. format(ADM, 24, DOF2_GetString(File, "Administrador"));
  2213. format(Motivo2, 56, DOF2_GetString(File, "Motivo"));
  2214. Tempo1 = DOF2_GetInt(File, "Tempo");
  2215. format(Str, 256, "%s | %s", ADM, pNomeOriginal[administrador]);
  2216. DOF2_SetString(File, "Administrador", Str);
  2217. format(Str, 256, "%s | %s", Motivo2, Motivo1);
  2218. DOF2_SetString(File, "Motivo", Str);
  2219. DOF2_SetInt(File, "Tempo", tempo + Tempo1);
  2220. DOF2_SaveFile();
  2221. }
  2222. }
  2223. return 1;
  2224. }
  2225.  
  2226. stock BanirIP(playerid, administrador, Motivo1[])
  2227. {
  2228. new Data[24], Dia, Mes, Ano, Hora, Minuto;
  2229. gettime(Hora, Minuto);
  2230. getdate(Ano, Mes, Dia);
  2231. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  2232. format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", GetPlayerIpEx(playerid));
  2233. DOF2_CreateFile(File);
  2234. DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
  2235. DOF2_SetString(File, "Motivo", Motivo1);
  2236. DOF2_SetString(File, "Data", Data);
  2237. DOF2_SaveFile();
  2238. format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[administrador], Motivo1);
  2239. SendClientMessageToAll(VermelhoEscuro, Str);
  2240. Log("pAdmin/Logs/BanirIP.ini", Str);
  2241. Kick(playerid);
  2242. return 1;
  2243. }
  2244. stock CriarDados(playerid)
  2245. {
  2246. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  2247. if(!DOF2_FileExists(File)) DOF2_CreateFile(File);
  2248. DOF2_SetString(File, "pSenha", PlayerInfo[playerid][pSenha]);
  2249. DOF2_SetInt(File, "pLevel", LEVELINICIAL);
  2250. DOF2_SetInt(File, "pSkin", SKININICIAL);
  2251. DOF2_SetInt(File, "pDinheiro", DINHEIROINICIAL);
  2252. DOF2_SetInt(File, "pSegundosJogados", 0);
  2253. DOF2_SetInt(File, "pAvisos", 0);
  2254. DOF2_SetInt(File, "pCadeia", 0);
  2255. DOF2_SetInt(File, "pAdmin", 0);
  2256. DOF2_SetString(File, "pLastLogin", "-");
  2257. DOF2_SetInt(File, "pInterior", 0);
  2258. DOF2_SetFloat(File, "pPosX", SPAWNX);
  2259. DOF2_SetFloat(File, "pPosY", SPAWNY);
  2260. DOF2_SetFloat(File, "pPosZ", SPAWNZ);
  2261. DOF2_SetFloat(File, "pPosA", SPAWNA);
  2262. DOF2_SetFloat(File, "pCamX", 0.0);
  2263. DOF2_SetFloat(File, "pCamY", 0.0);
  2264. DOF2_SetFloat(File, "pCamZ", 0.0);
  2265. DOF2_SetBool(File, "pCongelado", false);
  2266. DOF2_SetBool(File, "pCalado", false);
  2267. DOF2_SaveFile();
  2268. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo ao servidor %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
  2269. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Seja bem vindo ao servidor...", Str, "Validar", "Cancelar");
  2270. return 1;
  2271. }
  2272.  
  2273. stock CarregarDados(playerid)
  2274. {
  2275. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  2276. if(!DOF2_FileExists(File)) return SendClientMessage(playerid, Vermelho, "Os dados não puderam ser carregados, tente novamente."), Kick(playerid);
  2277. //
  2278. format(PlayerInfo[playerid][pSenha], 24, DOF2_GetString(File, "pSenha"));
  2279. format(PlayerInfo[playerid][pLastLogin], 24, DOF2_GetString(File, "pLastLogin"));
  2280. PlayerInfo[playerid][pLevel] = DOF2_GetInt(File, "pLevel");
  2281. PlayerInfo[playerid][pSkin] = DOF2_GetInt(File, "pSkin");
  2282. PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File, "pDinheiro");
  2283. PlayerInfo[playerid][pSegundosJogados] = DOF2_GetInt(File, "pSegundosJogados");
  2284. PlayerInfo[playerid][pAvisos] = DOF2_GetInt(File, "pAvisos");
  2285. PlayerInfo[playerid][pCadeia] = DOF2_GetInt(File, "pCadeia");
  2286. PlayerInfo[playerid][pAdmin] = DOF2_GetInt(File, "pAdmin");
  2287. PlayerInfo[playerid][pInterior] = DOF2_GetInt(File, "pInterior");
  2288. PlayerInfo[playerid][pPosX] = DOF2_GetFloat(File, "pPosX");
  2289. PlayerInfo[playerid][pPosY] = DOF2_GetFloat(File, "pPosY");
  2290. PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(File, "pPosZ");
  2291. PlayerInfo[playerid][pPosA] = DOF2_GetFloat(File, "pPosA");
  2292. PlayerInfo[playerid][pCamX] = DOF2_GetFloat(File, "pCamX");
  2293. PlayerInfo[playerid][pCamY] = DOF2_GetFloat(File, "pCamY");
  2294. PlayerInfo[playerid][pCamZ] = DOF2_GetFloat(File, "pCamZ");
  2295. PlayerInfo[playerid][pCongelado] = DOF2_GetBool(File, "pCongelado");
  2296. PlayerInfo[playerid][pCalado] = DOF2_GetBool(File, "pCalado");
  2297. //
  2298. if(FirstLogin[playerid] == false)
  2299. {
  2300. ShowPlayerDialog(playerid, DIALOG_POS, DIALOG_STYLE_MSGBOX, "{E9967A}Você gostaria de...", "{BEBEBE}Você gostaria de Spawnar na posição onde deslogou pela última vez ?", "SIM", "NÃO");
  2301. format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo {FFFF00}%s{BEBEBE}. Seu último login foi em {FFFF00}%s{BEBEBE}.", pNomeOriginal[playerid], PlayerInfo[playerid][pLastLogin]);
  2302. SendClientMessage(playerid, Branco, Str);
  2303. }
  2304. else
  2305. {
  2306. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], SPAWNX, SPAWNY, SPAWNZ, SPAWNA, 0, 0, 0, 0, 0, 0);
  2307. SpawnPlayer(playerid);
  2308. FirstLogin[playerid] = false;
  2309. }
  2310. pLogado[playerid] = true;
  2311. if(PlayerInfo[playerid][pAdmin] > 0) pJogando[playerid] = false;
  2312. return 1;
  2313. }
  2314.  
  2315. stock SalvarDados(playerid)
  2316. {
  2317. format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
  2318. if(!DOF2_FileExists(File)) DOF2_CreateFile(File);
  2319. //
  2320. new Data[24], Dia, Mes, Ano, Hora, Minuto, Float:A, Float:X, Float:Y, Float:Z;
  2321. GetPlayerCameraPos(playerid, X, Y, Z);
  2322. gettime(Hora, Minuto);
  2323. getdate(Ano, Mes, Dia);
  2324. format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
  2325. //
  2326. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  2327. GetPlayerFacingAngle(playerid, A);
  2328. DOF2_SetString(File, "pSenha", PlayerInfo[playerid][pSenha]);
  2329. DOF2_SetInt(File, "pLevel", GetPlayerScore(playerid));
  2330. DOF2_SetInt(File, "pSkin", GetPlayerSkin(playerid));
  2331. DOF2_SetInt(File, "pDinheiro", GetPlayerMoney(playerid));
  2332. DOF2_SetInt(File, "pSegundosJogados", PlayerInfo[playerid][pSegundosJogados]);
  2333. DOF2_SetInt(File, "pAvisos", PlayerInfo[playerid][pAvisos]);
  2334. DOF2_SetInt(File, "pCadeia", PlayerInfo[playerid][pCadeia]);
  2335. DOF2_SetInt(File, "pAdmin", PlayerInfo[playerid][pAdmin]);
  2336. DOF2_SetString(File, "pLastLogin", Data);
  2337. DOF2_SetInt(File, "pInterior", GetPlayerInterior(playerid));
  2338. DOF2_SetFloat(File, "pPosX", Pos[0]);
  2339. DOF2_SetFloat(File, "pPosY", Pos[1]);
  2340. DOF2_SetFloat(File, "pPosZ", Pos[2]);
  2341. DOF2_SetFloat(File, "pPosA", A);
  2342. DOF2_SetFloat(File, "pCamX", X);
  2343. DOF2_SetFloat(File, "pCamY", Y);
  2344. DOF2_SetFloat(File, "pCamZ", Z);
  2345. DOF2_SetBool(File, "pCongelado", PlayerInfo[playerid][pCongelado]);
  2346. DOF2_SetBool(File, "pCalado", PlayerInfo[playerid][pCalado]);
  2347. DOF2_SaveFile();
  2348. return 1;
  2349. }
  2350.  
  2351. stock GetPlayerIpEx(playerid)
  2352. {
  2353. new pIP[36];
  2354. GetPlayerIp(playerid, pIP, 36);
  2355. return pIP;
  2356. }
  2357.  
  2358. stock Log(Arquivo[], string[])
  2359. {
  2360. if(!DOF2_FileExists(Arquivo))
  2361. {
  2362. DOF2_CreateFile(Arquivo);
  2363. }
  2364. new dia, mes, ano, hora, minuto, segundo, Data[24];
  2365. gettime(hora, minuto, segundo);
  2366. getdate(ano, mes, dia);
  2367. format(Data, 24, "%02d/%02d/%d - %02d:%02d:%02d", dia, mes, ano, hora, minuto, segundo);
  2368. DOF2_SetString(Arquivo, Data, string);
  2369. DOF2_SaveFile();
  2370. }
  2371.  
  2372. stock DeletarLog(const File1[])
  2373. {
  2374. if(!fexist(File1))
  2375. {
  2376. printf("Esse arquivo não existe, utilize Log(\"arquivo\"");
  2377. return 0;
  2378. }
  2379. fremove(File1);
  2380. return 1;
  2381. }
  2382.  
  2383. stock SendAdminMessage(Cor, Mensagem[])
  2384. {
  2385. for(new i = 0; i < MAX_PLAYERS; i++)
  2386. {
  2387. if(PlayerInfo[i][pAdmin] > 0)
  2388. {
  2389. SendClientMessage(i, Cor, Mensagem);
  2390. }
  2391. }
  2392. return 1;
  2393. }
  2394.  
  2395. stock SetPlayerMoney(ID1, Quantia)
  2396. {
  2397. ResetPlayerMoney(ID1);
  2398. GivePlayerMoney(ID1, Quantia);
  2399. return 1;
  2400. }
  2401.  
  2402. stock GetVehicleDriver(vehicleid)
  2403. {
  2404. for(new i; i < MAX_PLAYERS; i++)
  2405. {
  2406. if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2) return i;
  2407. }
  2408. return -1;
  2409. }
  2410.  
  2411. stock GetVehiclePassenger(vehicleid)
  2412. {
  2413. for(new i; i < MAX_PLAYERS; i++)
  2414. {
  2415. if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 3) return i;
  2416. }
  2417. return -1;
  2418. }
Advertisement
Add Comment
Please, Sign In to add comment