Advertisement
Guest User

MFAdmin v1.1

a guest
Sep 27th, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 29.78 KB | None | 0 0
  1. #include <a_samp>
  2. #include <DOF2>
  3. #include <sscanf2>
  4. #include <YSI\y_commands>
  5. //IMPORTANTE
  6. #define ALL_VEHICLES 2001 //SUBSTITUA O 2001 PELO |NÚMERO DE CARROS DO SEU SERVIDOR +1| EX: 501
  7. //===========
  8. #define FILTERSCRIPT
  9. #define loop(%0,%1) for(new %0; %0 < %1; ++%0)
  10. #define MSGPlayer SendClientMessage
  11. #define MSGAll SendClientMessageToAll
  12. //Cores
  13. #define AZUL_CLARO 0x00BFFFFF
  14. #define VERMELHO 0xFF0000FF
  15. #define ROSA 0xFF00FFFF
  16. #define CINZA 0x8B8989FF
  17. #define CIANO 0x00FFFFFF
  18. #define VERDE 0x00FF00FF
  19. #define AMARELO 0xFFFF00FF
  20. //==============
  21. new pLogado[MAX_PLAYERS], pSpectating[MAX_PLAYERS];
  22. native CriarPasta(pasta[]);
  23. forward SavePlayer(playerid);
  24. forward LoadPlayer(playerid);
  25. forward BanPlayer(playerid, string[], string2[]);
  26. forward DesbanPlayer(playerid,string[]);
  27. forward CheckBan(playerid);
  28. forward KickP2(playerid);
  29. forward AdminChat(playerid, cor,string[]);
  30. forward LimparChat(playerid, linhas);
  31.  
  32. enum adms {
  33.     Admin,
  34.     Avisos
  35. };
  36. new PlayerInfo[MAX_PLAYERS][adms];
  37.  
  38. public OnFilterScriptInit()
  39. {
  40.     new arquivo[30];
  41.     print("\n--------------------------------------");
  42.     print(" Admins System by --Mandrack_FreeZe--");
  43.     print(" >> www.sa-mp.com <<");
  44.     print(" >>MFAdmin 1.1<<");
  45.     print("--------------------------------------\n");
  46.     format(arquivo, sizeof(arquivo), "MFAdmin");
  47.     if(!DOF2_FileExists(arquivo))
  48.     {
  49.         CriarPasta("scriptfiles\\MFAdmin");
  50.         print("\nA pasta MFAdmin foi criada com sucesso!");
  51.     }
  52.     format(arquivo, sizeof(arquivo), "MFAdmin/Contas");
  53.     if(!DOF2_FileExists(arquivo))
  54.     {
  55.         CriarPasta("scriptfiles\\MFAdmin\\Contas");
  56.         print("\nA pasta MFAdmin/Contas foi criada com sucesso!");
  57.     }
  58.     format(arquivo, sizeof(arquivo), "MFAdmin/IPBan");
  59.     if(!DOF2_FileExists(arquivo))
  60.     {
  61.         CriarPasta("scriptfiles\\MFAdmin\\IPBan");
  62.         print("\nA pasta MFAdmin/IPBan foi criada com sucesso!");
  63.     }
  64.     format(arquivo, sizeof(arquivo), "MFAdmin/NomesBan");
  65.     if(!DOF2_FileExists(arquivo))
  66.     {
  67.         CriarPasta("scriptfiles\\MFAdmin\\NomesBan");
  68.         print("\nA pasta MFAdmin/NomesBan foi criada com sucesso!");
  69.     }
  70.     loop(i, GetMaxPlayers())
  71.     {
  72.         LoadPlayer(i);
  73.     }
  74.     return 1;
  75. }
  76.  
  77. public OnFilterScriptExit()
  78. {
  79.     DOF2_Exit();
  80.     loop(i, GetMaxPlayers())
  81.     {
  82.         SavePlayer(i);
  83.     }
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerConnect(playerid)
  88. {
  89.     pLogado[playerid] = 0;
  90.     CheckBan(playerid);
  91.     return 1;
  92. }
  93.  
  94. public OnPlayerDisconnect(playerid, reason)
  95. {
  96.     pLogado[playerid] = 0;
  97.     SavePlayer(playerid);
  98.     return 1;
  99. }
  100.  
  101. public OnPlayerSpawn(playerid)
  102. {
  103.     if(pLogado[playerid] == 0)
  104.     {
  105.         new string[60];
  106.         LoadPlayer(playerid);
  107.         pLogado[playerid] = 1;
  108.         if(PlayerInfo[playerid][Avisos] > 3)
  109.         {
  110.             PlayerInfo[playerid][Avisos] = 0;
  111.         }
  112.         if(PlayerInfo[playerid][Admin] > 0)
  113.         {
  114.             format(string, sizeof(string), "~r~%s ~g~ON", PlayerName(playerid));
  115.             GameTextForAll(string, 3000, 1);
  116.         }
  117.     }
  118.     return 1;
  119. }
  120.  
  121. public AdminChat(playerid, cor,string[])
  122. {
  123.     loop(i, GetMaxPlayers())
  124.     {
  125.         if(IsPlayerConnected(i))
  126.         {
  127.             if(PlayerInfo[i][Admin] >= 1)
  128.             {
  129.                 new str[126];
  130.                 format(str, sizeof(str), "%s", string);
  131.                 MSGPlayer(i, cor, str);
  132.             }
  133.         }
  134.    
  135.     }
  136.     return 1;
  137. }
  138.  
  139. public SavePlayer(playerid)
  140. {
  141.     new arquivo[60];
  142.     format(arquivo, sizeof(arquivo), "MFAdmin/Contas/%s.ini", PlayerName(playerid));
  143.     if(pLogado[playerid] == 1)
  144.     {
  145.         DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
  146.         DOF2_SetInt(arquivo, "Avisos", PlayerInfo[playerid][Avisos]);
  147.         DOF2_SaveFile();
  148.     }
  149.     return 1;
  150. }
  151.  
  152. public LoadPlayer(playerid)
  153. {
  154.     new arquivo[50];
  155.     format(arquivo, sizeof(arquivo), "MFAdmin/Contas/%s.ini", PlayerName(playerid));
  156.     if(DOF2_FileExists(arquivo))
  157.     {
  158.         PlayerInfo[playerid][Admin] = DOF2_GetInt(arquivo, "Admin");
  159.         PlayerInfo[playerid][Avisos] = DOF2_GetInt(arquivo, "Avisos");
  160.     }else
  161.     {
  162.         DOF2_CreateFile(arquivo);
  163.         DOF2_SetInt(arquivo, "Admin", 0);
  164.         DOF2_SetInt(arquivo, "Avisos", 0);
  165.         DOF2_SaveFile();
  166.     }
  167.     return 1;
  168. }
  169.  
  170. public BanPlayer(playerid, string[],string2[])
  171. {
  172.     new arquivo[50], data[20], dia, mes, ano, pIP[16];
  173.     GetPlayerIp(playerid, pIP, sizeof(pIP));
  174.     getdate(ano, mes, dia);
  175.     format(data, sizeof(data), "%d/%d/%d",dia, mes, ano);
  176.     format(arquivo, sizeof(arquivo), "MFAdmin/IPBan/%s.ini", pIP);
  177.     if(DOF2_FileExists(arquivo)) return MSGPlayer(playerid, CINZA, "Este player já tem o IP banido!");
  178.     else
  179.     {
  180.         DOF2_CreateFile(arquivo);
  181.         DOF2_SetString(arquivo, "Admin", string);
  182.         DOF2_SetString(arquivo, "Motivo", string2);
  183.         DOF2_SetString(arquivo, "Data", data);
  184.         DOF2_SetString(arquivo, "Nick", PlayerName(playerid));
  185.         DOF2_SaveFile();
  186.     }
  187.     format(arquivo, sizeof(arquivo), "MFAdmin/NomesBan/%s.ini", PlayerName(playerid));
  188.     if(DOF2_FileExists(arquivo)) return MSGPlayer(playerid, CINZA, "Este player já tem o nome banido!");
  189.     else
  190.     {
  191.         DOF2_CreateFile(arquivo);
  192.         DOF2_SetString(arquivo, "Admin", string);
  193.         DOF2_SetString(arquivo, "Motivo", string2);
  194.         DOF2_SetString(arquivo, "Data", data);
  195.         DOF2_SetString(arquivo, "IP", pIP);
  196.         DOF2_SaveFile();
  197.     }
  198.     KickP(playerid);
  199.     return 1;
  200. }
  201.  
  202. public DesbanPlayer(playerid ,string[])
  203. {
  204.     new arquivo[50], arquivo2[50], str[80];
  205.     format(arquivo, sizeof(arquivo), "MFAdmin/IPBan/%s.ini", string);
  206.     if(DOF2_FileExists(arquivo))
  207.     {
  208.         format(arquivo2, sizeof(arquivo2), "MFAdmin/NomesBan/%s.ini", DOF2_GetString(arquivo, "Nick"));
  209.         format(str, sizeof(str), "O IP %s (%s) foi desbanido com sucesso!", string,DOF2_GetString(arquivo, "Nick"));
  210.         DOF2_RemoveFile(arquivo2);
  211.         DOF2_RemoveFile(arquivo);
  212.         MSGPlayer(playerid, AZUL_CLARO, str);
  213.     } else { MSGPlayer(playerid, CINZA, "O IP não existe na base de dados!"); }
  214.     return 1;
  215. }
  216.  
  217. public CheckBan(playerid)
  218. {
  219.     new arquivo[60], ip[16], string[150];
  220.     GetPlayerIp(playerid, ip, sizeof(ip));
  221.     format(arquivo, sizeof(arquivo), "MFAdmin/IPBan/%s.ini", ip);
  222.     if(DOF2_FileExists(arquivo))
  223.     {
  224.         format(string, sizeof(string), "\tSua conta está banida do servidor!\nNick:%s\nAdmin: %s\nMotivo: %s\nDia: %s", DOF2_GetString(arquivo, "Nick"), DOF2_GetString(arquivo, "Admin"),DOF2_GetString(arquivo, "Motivo"), DOF2_GetString(arquivo, "Data"));
  225.         ShowPlayerDialog(playerid,1973,DIALOG_STYLE_MSGBOX,"Conta banida!",string,"Fechar","");
  226.         KickP(playerid);
  227.     } else
  228.     {
  229.           PlayerInfo[playerid][Admin] = 0;
  230.     }
  231.     return 1;
  232. }
  233.  
  234. public KickP2(playerid)
  235. {
  236.     Kick(playerid);
  237.     return 1;
  238. }
  239. public LimparChat(playerid, linhas)
  240. {
  241.     if(IsPlayerConnected(playerid))
  242.     {
  243.         loop(i, linhas)
  244.         {
  245.             MSGPlayer(playerid, -1, " ");
  246.         }
  247.    
  248.     }
  249.     return 1;
  250. }
  251.  
  252.  
  253. stock PlayerName(playerid)
  254. {
  255.     new pName[MAX_PLAYER_NAME];
  256.     GetPlayerName(playerid, pName, sizeof(pName));
  257.     return pName;
  258. }
  259.  
  260. stock KickP(playerid)
  261. {
  262.     SetTimerEx("KickP2", 200, false, "d", playerid);
  263.     return 1;
  264. }
  265.  
  266. stock CheckCar(playerid, vehicleid, Float:raio)
  267. {
  268.     if(IsPlayerConnected(playerid))
  269.     {
  270.         new Float:x, Float:y, Float:z, Float:vx, Float:vy, Float:vz, Float:distancia;
  271.         GetVehiclePos(vehicleid, vx, vy, vz);
  272.         GetPlayerPos(playerid, x, y, z);
  273.         distancia = (vx-x) * (vx-x) + (vy-y) * (vy-y) + (vz-z) * (vz-z);
  274.         if(distancia <= raio*raio)
  275.         {
  276.             return 1;
  277.         }
  278.     }
  279.     return 0;
  280. }
  281.  
  282. YCMD:aa(playerid, params[], help)
  283. {
  284.     if(PlayerInfo[playerid][Admin] < 1)
  285.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  286.     if(PlayerInfo[playerid][Admin] >= 1)
  287.     {
  288.         MSGPlayer(playerid, AZUL_CLARO, "MFAdmin - Level 1 - ** /setar /explodir /kick /pm /ir /trazer /tv /tapa /tapao /av(avisar) /ban /a /vid **");
  289.     }
  290.     if(PlayerInfo[playerid][Admin] >= 2)
  291.     {
  292.         MSGPlayer(playerid, VERMELHO, "MFAdmin - Level 2 - ** /rc /darvida /darcolete /desban /horaservidor /tempo /aviso /limparchat **");
  293.         MSGPlayer(playerid, VERMELHO, "MFAdmin - Level 2 - ** /setarcarro /repararcarro **");
  294.     }
  295.     if(PlayerInfo[playerid][Admin] >= 3)
  296.     {
  297.         MSGPlayer(playerid, ROSA, "MFAdmin - Level 3 - ** /salvartodos /daradmin /tiraradmin /afs(Abrir FS) /ffs(Fechar FS) /nomeserver **");
  298.         MSGPlayer(playerid, ROSA, "MFAdmin - Level 3 - ** /gmx /banrcon /reloadban (RCON) /biprcon (Ban IP RCON) /desbanip (RCON) **");
  299.     }
  300.    
  301.     return 1;
  302. }
  303.  
  304. YCMD:vid(playerid, params[], help)
  305. {
  306.     if(PlayerInfo[playerid][Admin] < 1)
  307.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  308.     new string[60], idv;
  309.     if(!IsPlayerInAnyVehicle(playerid))
  310.         return MSGPlayer(playerid, CINZA, "Você não está dentro de um veiculo!");
  311.     idv = GetPlayerVehicleID(playerid);
  312.     format(string, sizeof(string), "O ID do carro é: %d", idv);
  313.     MSGPlayer(playerid, VERDE,string);
  314.     return 1;
  315. }
  316.  
  317. YCMD:repararcarro(playerid, params[], help)
  318. {
  319.     if(IsPlayerConnected(playerid))
  320.     {
  321.         if(PlayerInfo[playerid][Admin] < 2)
  322.             return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  323.         new idv, idvmax=0,string[60];
  324.         loop(i, MAX_VEHICLES)
  325.         {
  326.             new check = CheckCar(playerid, i, 5);
  327.             if(check)
  328.             {
  329.                 idv = i;
  330.                 ++idvmax;
  331.             }
  332.         }
  333.         switch(idvmax)
  334.         {
  335.             case 0:
  336.             {
  337.                 MSGPlayer(playerid, CINZA, "Não há nenhum carro por perto.");
  338.                 return 1;
  339.             }
  340.             case 1:
  341.             {
  342.                 format(string, sizeof(string), "Você reparou o carro %d", idv);
  343.                 MSGPlayer(playerid, VERDE,string);
  344.                 SetVehicleHealth(idv, 100);
  345.                 RepairVehicle(idv);
  346.                 return 1;
  347.             }
  348.             default:
  349.             {
  350.                 MSGPlayer(playerid, CINZA, "Há mais de 1 carro nesse local.");
  351.                 return 1;
  352.             }
  353.         }
  354.     }
  355.     return 1;
  356. }
  357.  
  358. YCMD:setarcarro(playerid, params[], help)
  359. {
  360.     if(IsPlayerConnected(playerid))
  361.     {
  362.         if(PlayerInfo[playerid][Admin] < 2)
  363.             return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  364.         new idv, idvmax=0,string[60];
  365.         loop(i, MAX_VEHICLES)
  366.         {
  367.             new check = CheckCar(playerid, i, 5);
  368.             if(check)
  369.             {
  370.                 idv = i;
  371.                 ++idvmax;
  372.             }
  373.         }
  374.         switch(idvmax)
  375.         {
  376.             case 0:
  377.             {
  378.                 MSGPlayer(playerid, CINZA, "Não há nenhum carro por perto.");
  379.                 return 1;
  380.             }
  381.             case 1:
  382.             {
  383.                 format(string, sizeof(string), "Você setou o carro %d", idv);
  384.                 MSGPlayer(playerid, VERDE,string);
  385.                 SetVehicleToRespawn(idv);
  386.                 return 1;
  387.             }
  388.             default:
  389.             {
  390.                 MSGPlayer(playerid, CINZA, "Há mais de 1 carro nesse local.");
  391.                 return 1;
  392.             }
  393.         }
  394.     }
  395.     return 1;
  396. }
  397.  
  398. YCMD:setar(playerid, params[], help)
  399. {
  400.     if(PlayerInfo[playerid][Admin] < 1)
  401.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  402.     new id, string[60];
  403.     if(sscanf(params, "u", id))
  404.         return MSGPlayer(playerid, CINZA, "Utilize /setar [ID]");
  405.     if(!IsPlayerConnected(id))
  406.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  407.     SpawnPlayer(id);
  408.     format(string, sizeof(string), "Você setou o player %s", PlayerName(id));
  409.     MSGPlayer(playerid, VERDE,string);
  410.     return 1;
  411. }
  412.  
  413. YCMD:salvartodos(playerid, params[], help)
  414. {
  415.     if(PlayerInfo[playerid][Admin] < 3)
  416.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  417.     loop(i, GetMaxPlayers())
  418.     {
  419.         if(IsPlayerConnected(i))
  420.         {
  421.             SavePlayer(i);
  422.         }
  423.     }
  424.     MSGPlayer(playerid, VERDE, "Você salvou a conta de todos os player online.");
  425.     return 1;
  426. }
  427.  
  428. YCMD:rc(playerid, params[], help)
  429. {
  430.     if(PlayerInfo[playerid][Admin] < 2)
  431.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  432.     new string[80], bool:carroOcupied[ALL_VEHICLES];
  433.     loop(i, GetMaxPlayers())
  434.     {
  435.         if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
  436.         {
  437.             carroOcupied[GetPlayerVehicleID(i)] = true;
  438.         }
  439.     }
  440.     loop(c, ALL_VEHICLES)
  441.     {
  442.         if(!carroOcupied[c])
  443.         {
  444.             RepairVehicle(c);
  445.             SetVehicleHealth(c, 100);
  446.             SetVehicleToRespawn(c);
  447.         }
  448.     }
  449.     format(string, sizeof(string), "O Admin %s respawnou os carros do servidor.", PlayerName(playerid));
  450.     MSGAll(VERMELHO, string);
  451.     return 1;
  452. }
  453.  
  454. YCMD:explodir(playerid, params[], help)
  455. {
  456.     if(PlayerInfo[playerid][Admin] < 1)
  457.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  458.     new id, string[80];
  459.     if(sscanf(params, "u", id))
  460.         return MSGPlayer(playerid, CINZA, "Utilize /explodir [ID]");
  461.     if(!IsPlayerConnected(id))
  462.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  463.     new Float:x, Float:y, Float:z;
  464.     GetPlayerPos(id, x, y, z);
  465.     CreateExplosion(x, y, z, 10, 3);
  466.     format(string, sizeof(string), "Explosão concluida no player %s", PlayerName(id));
  467.     MSGPlayer(playerid, VERDE, string);
  468.     return 1;
  469. }
  470.  
  471. YCMD:darcolete(playerid, params[], help)
  472. {
  473.     if(PlayerInfo[playerid][Admin] < 2)
  474.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  475.     new id, Float:colete, string[80];
  476.     if(sscanf(params, "uf", id, colete))
  477.         return MSGPlayer(playerid, CINZA, "Utilize /setcolete [ID] [COLETE]");
  478.     if(!IsPlayerConnected(id))
  479.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  480.     SetPlayerArmour(id, colete);
  481.     format(string, sizeof(string), "Você setou o colete do player %s para %f", PlayerName(id), colete);
  482.     MSGPlayer(playerid, VERDE, string);
  483.     return 1;
  484. }
  485.  
  486. YCMD:darvida(playerid, params[], help)
  487. {
  488.     if(PlayerInfo[playerid][Admin] < 2)
  489.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  490.     new id, Float:vida, string[80];
  491.     if(sscanf(params, "uf", id, vida))
  492.         return MSGPlayer(playerid, CINZA, "Utilize /setvida [ID] [VIDA]");
  493.     if(!IsPlayerConnected(id))
  494.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  495.     SetPlayerHealth(id, vida);
  496.     format(string, sizeof(string), "Você setou a vida do player %s para %f", PlayerName(id), vida);
  497.     MSGPlayer(playerid, VERDE, string);
  498.     return 1;
  499. }
  500.  
  501. YCMD:relatar(playerid, params[], help)
  502. {
  503.     new relato[80], string[126];
  504.     if(sscanf(params, "s[80]", relato))
  505.         return MSGPlayer(playerid, CINZA, "Utilize /relato [RELATORIO]");
  506.     MSGPlayer(playerid, VERDE, "Seu relato foi enviado aos administradores...");
  507.     format(string, sizeof(string), "Relato de %s[%d]: %s", PlayerName(playerid), playerid, relato);
  508.     AdminChat(playerid, AMARELO, string);
  509.     return 1;
  510. }
  511.  
  512. YCMD:admins(playerid, params[], help)
  513. {
  514.     new string[60];
  515.     MSGPlayer(playerid, VERDE, "=-=-=-=-=-=-=-=-=-=-=Admins Online=-=-=-=-=-=-=-=-=-=-=");
  516.     loop(i, GetMaxPlayers())
  517.     {
  518.         if(IsPlayerConnected(i) == 1 && PlayerInfo[i][Admin] >= 1)
  519.         {
  520.             format(string, sizeof(string), "Admin %s[%d] | Level: %d", PlayerName(i), i,PlayerInfo[i][Admin]);
  521.             MSGPlayer(playerid, ROSA, string);
  522.         }
  523.    
  524.     }
  525.     return 1;
  526. }
  527.  
  528. YCMD:desbanip(playerid, params[], help)
  529. {
  530.     if(PlayerInfo[playerid][Admin] < 3)
  531.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  532.     new ip[16], string[60];
  533.     if(sscanf(params, "s[16]", ip))
  534.         return MSGPlayer(playerid, CINZA, "Utilize /desbanip [IP]");
  535.     format(string, sizeof(string), "unbanip %s", ip);
  536.     SendRconCommand(string);
  537.     format(string, sizeof(string), "Você desbanio o ip %s da RCON", ip);
  538.     MSGPlayer(playerid, VERMELHO, string);
  539.     return 1;
  540. }
  541.  
  542. YCMD:limparchat(playerid, params[], help)
  543. {
  544.     if(PlayerInfo[playerid][Admin] < 2)
  545.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  546.     loop(i, GetMaxPlayers())
  547.     {
  548.         if(IsPlayerConnected(i))
  549.         {
  550.             LimparChat(i,50);
  551.         }
  552.     }
  553.     new string[50];
  554.     format(string, sizeof(string), "O admin~g~ %s ~n~limpou o chat", PlayerName(playerid));
  555.     GameTextForAll(string, 5000, 1);
  556.     return 1;
  557. }
  558.  
  559. YCMD:gmx(playerid, params[], help)
  560. {
  561.     if(PlayerInfo[playerid][Admin] < 3)
  562.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  563.     loop(i, GetMaxPlayers())
  564.     {
  565.         if(IsPlayerConnected(i))
  566.         {
  567.             SavePlayer(i);
  568.             ShowPlayerDialog(i,1574,DIALOG_STYLE_MSGBOX,"GMX","\tGMX\n Não deslogue do servidor.\n Aguarde","Ok","");
  569.         }
  570.     }
  571.     SendRconCommand("gmx");
  572.     return 1;
  573. }
  574.  
  575. YCMD:biprcon(playerid, params[], help)
  576. {
  577.     if(PlayerInfo[playerid][Admin] < 3)
  578.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  579.     new ip[16], string[60];
  580.     if(sscanf(params, "s[16]", ip))
  581.         return MSGPlayer(playerid, CINZA, "Utilize /biprcon [IP]");
  582.     format(string, sizeof(string), "banip %s", ip);
  583.     SendRconCommand(string);
  584.     format(string, sizeof(string), "Você banio ip %s na RCON", ip);
  585.     MSGPlayer(playerid, VERMELHO, string);
  586.     return 1;
  587. }
  588.  
  589. YCMD:reloadban(playerid, params[], help)
  590. {
  591.     if(PlayerInfo[playerid][Admin] < 3)
  592.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  593.     SendRconCommand("reloadbans");
  594.     MSGPlayer(playerid, VERMELHO, "Bans do RCON resetados!");
  595.     return 1;
  596. }
  597.  
  598. YCMD:banrcon(playerid, params[], help)
  599. {
  600.     if(PlayerInfo[playerid][Admin] < 3)
  601.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  602.     new id, string[60];
  603.     if(sscanf(params, "u", id))
  604.         return MSGPlayer(playerid, CINZA, "Utilize /banrcon [ID]");
  605.     if(!IsPlayerConnected(id))
  606.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  607.     Ban(id);
  608.     format(string, sizeof(string), "Você banio o player %s na RCON", PlayerName(id));
  609.     MSGPlayer(playerid, VERMELHO, string);
  610.     return 1;
  611. }
  612.  
  613. YCMD:nomeserver(playerid, params[], help)
  614. {
  615.     if(PlayerInfo[playerid][Admin] < 3)
  616.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  617.     new nomeserver[40], string[100];
  618.     if(sscanf(params, "s[40]", nomeserver))
  619.         return MSGPlayer(playerid, CINZA, "Utilize /nomeserver [NOME]");
  620.     format(string, sizeof(string), "hostname %s", nomeserver);
  621.     SendRconCommand(string);
  622.     format(string, sizeof(string), "Você mudou o nome do servidor para: %s", nomeserver);
  623.     return 1;
  624. }
  625.  
  626. YCMD:aviso(playerid, params[], help)
  627. {
  628.     if(PlayerInfo[playerid][Admin] < 2)
  629.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  630.     new id, motivo[60], string[100];
  631.     if(sscanf(params, "us[60]", id, motivo))
  632.         return MSGPlayer(playerid, CINZA, "Utilize /aviso [ID] [MOTIVO]");
  633.     if(!IsPlayerConnected(id)) return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  634.     PlayerInfo[id][Avisos]++;
  635.     if(PlayerInfo[id][Avisos] > 3)
  636.     {
  637.         BanPlayer(id, PlayerName(playerid), "Mais de 3 avisos");
  638.         format(string, sizeof(string), "%s foi banido pelo admin %s Motivo: Mais de 3 avisos.", PlayerName(playerid),PlayerName(id));
  639.         MSGAll(VERMELHO, string);
  640.     }else{
  641.         format(string, sizeof(string), "Admin %s deu um aviso no player %s Motivo: %s", PlayerName(playerid),PlayerName(id), motivo);
  642.         MSGAll(VERMELHO, string);
  643.     }
  644.     return 1;
  645. }
  646.  
  647. YCMD:tempo(playerid, params[], help)
  648. {
  649.     if(PlayerInfo[playerid][Admin] < 2)
  650.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  651.     new tempo, string[80];
  652.     if(sscanf(params, "d", tempo))
  653.         return MSGPlayer(playerid, CINZA, "Utilize /tempo [ID]");
  654.     SetWeather(tempo);
  655.     format(string, sizeof(string), "Admin %s mudou o tempo do servidor para %d", PlayerName(playerid),tempo);
  656.     MSGAll(AMARELO, string);
  657.     return 1;
  658. }
  659.  
  660. YCMD:horaservidor(playerid, params[], help)
  661. {
  662.     if(PlayerInfo[playerid][Admin] < 2)
  663.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  664.     new horas, string[80];
  665.     if(sscanf(params, "d", horas))
  666.         return MSGPlayer(playerid, CINZA, "Utilize /horaservidor [HORAS]");
  667.     SetWorldTime(horas);
  668.     format(string, sizeof(string), "Admin %s mudou a hora do servidor para %d", PlayerName(playerid),horas);
  669.     MSGAll(AMARELO, string);
  670.     return 1;
  671. }
  672.  
  673. YCMD:tv(playerid, params[], help)
  674. {
  675.     if(PlayerInfo[playerid][Admin] < 1)
  676.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  677.     new id, string[60], interior, vid;
  678.     if(pSpectating[playerid] == 1)
  679.     {
  680.         MSGPlayer(playerid, VERMELHO, "TV desligada.");
  681.         TogglePlayerSpectating(playerid, 0);
  682.         pSpectating[playerid] = 0;
  683.     }
  684.     if(sscanf(params, "u", id))
  685.         return MSGPlayer(playerid, CINZA, "Utilize /tv [ID]");
  686.     if(id == playerid)
  687.         return MSGPlayer(playerid, CINZA, "Não é possível dar TV em si mesmo!");
  688.     if(!IsPlayerConnected(id))
  689.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  690.     if(IsPlayerInAnyVehicle(id))
  691.     {
  692.         vid = GetPlayerVehicleID(id);
  693.         TogglePlayerSpectating(playerid, 1);
  694.         PlayerSpectateVehicle(playerid, vid);
  695.         format(string, sizeof(string), "Você está de TV no player %s", PlayerName(id));
  696.         MSGPlayer(playerid, AMARELO, string);
  697.         pSpectating[playerid] = 1;
  698.     } else {
  699.         TogglePlayerSpectating(playerid, 1);
  700.         PlayerSpectatePlayer(playerid, id);
  701.         interior = GetPlayerInterior(id);
  702.         SetPlayerInterior(playerid, interior);
  703.         format(string, sizeof(string), "Você está de TV no player %s", PlayerName(id));
  704.         MSGPlayer(playerid, AMARELO, string);
  705.         pSpectating[playerid] = 1;
  706.     }
  707.     return 1;
  708. }
  709.  
  710. YCMD:av(playerid, params[], help)
  711. {
  712.     if(PlayerInfo[playerid][Admin] < 1)
  713.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  714.     new msg[100], string[126];
  715.     if(sscanf(params, "s[100]", msg))
  716.         return MSGPlayer(playerid, CINZA, "Utilize /av [MENSSAGEM]");
  717.     MSGAll(AMARELO, "=-=-=-=-=-=-=-=-=-=-=Aviso da Administração=-=-=-=-=-=-=-=-=-=-=");
  718.     format(string, sizeof(string), "Admin %s[%d]: %s", PlayerName(playerid), PlayerInfo[playerid][Admin],msg);
  719.     MSGAll(CIANO, string);
  720.     return 1;
  721. }
  722.  
  723. YCMD:tapao(playerid, params[], help)
  724. {
  725.     new Float:x, Float:y, Float:z;
  726.     if(PlayerInfo[playerid][Admin] < 1)
  727.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  728.     new id, string[60];
  729.     if(sscanf(params, "u", id))
  730.         return MSGPlayer(playerid, CINZA, "Utilize /tapao [ID]");
  731.     if(!IsPlayerConnected(id))
  732.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  733.     GetPlayerPos(id, x, y, z);
  734.     SetPlayerPos(id, x, y, z+25);
  735.     format(string, sizeof(string), "Você deu um tapão no player %s", PlayerName(id));
  736.     MSGPlayer(playerid, AMARELO, string);
  737.     return 1;
  738. }
  739.  
  740. YCMD:tapa(playerid, params[], help)
  741. {
  742.     if(PlayerInfo[playerid][Admin] < 1)
  743.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  744.     new id, string[60], Float:x, Float:y, Float:z;
  745.     if(sscanf(params, "u", id))
  746.         return MSGPlayer(playerid, CINZA, "Utilize /tapa [ID]");
  747.     if(!IsPlayerConnected(id))
  748.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  749.     GetPlayerPos(id, x, y, z);
  750.     SetPlayerPos(id, x, y, z+12);
  751.     format(string, sizeof(string), "Você deu um tapa no player %s", PlayerName(id));
  752.     MSGPlayer(playerid, AMARELO, string);
  753.     return 1;
  754. }
  755.  
  756. YCMD:trazer(playerid, params[], help)
  757. {
  758.     if(PlayerInfo[playerid][Admin] < 1)
  759.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  760.     new id, string[60], interior, Float:x, Float:y, Float:z;
  761.     if(sscanf(params, "u", id))
  762.         return MSGPlayer(playerid, CINZA, "Utilize /trazer [ID]");
  763.     if(!IsPlayerConnected(id))
  764.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  765.     interior = GetPlayerInterior(playerid);
  766.     GetPlayerPos(playerid, x, y, z);
  767.     SetPlayerInterior(id, interior);
  768.     SetPlayerPos(id, x, y, z+3);
  769.     format(string, sizeof(string), "Você trouxe o player %s", PlayerName(id));
  770.     MSGPlayer(playerid, AMARELO, string);
  771.     return 1;
  772. }
  773.  
  774. YCMD:ir(playerid, params[], help)
  775. {
  776.     if(PlayerInfo[playerid][Admin] < 1)
  777.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  778.     new id, string[60], interior, Float:x, Float:y, Float:z;
  779.     if(sscanf(params, "u", id))
  780.         return MSGPlayer(playerid, CINZA, "Utilize /ir [ID]");
  781.     if(!IsPlayerConnected(id))
  782.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  783.     interior = GetPlayerInterior(id);
  784.     GetPlayerPos(id, x, y, z);
  785.     SetPlayerInterior(playerid, interior);
  786.     SetPlayerPos(playerid, x, y, z+3);
  787.     format(string, sizeof(string), "Você foi até %s", PlayerName(id));
  788.     MSGPlayer(playerid, AMARELO, string);
  789.     return 1;
  790. }
  791.  
  792. YCMD:pm(playerid, params[], help)
  793. {
  794.     //if(PlayerInfo[playerid][Admin] < 1) return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!"); DESCOMENTE ESSA LINHA PARA DESATIVAR A PM PARA PLAYERS
  795.     new id, msg[100], string[126];
  796.     if(sscanf(params, "us[100]", id, msg))
  797.         return MSGPlayer(playerid, CINZA, "Utilize /pm [ID] [MENSSAGEM]");
  798.     if(!IsPlayerConnected(id))
  799.         return MSGPlayer(playerid, CINZA, "O player não está conectado!");
  800.     if(PlayerInfo[playerid][Admin] < 1)
  801.     {
  802.         if(PlayerInfo[id][Admin] < 1)
  803.             return MSGPlayer(playerid, CINZA, "O player não é um admin!");
  804.         format(string, sizeof(string), "PM de %s: %s", PlayerName(playerid), msg);
  805.         MSGPlayer(id, AMARELO, string);
  806.         format(string, sizeof(string), "PM enviada para %s", PlayerName(id));
  807.         MSGPlayer(playerid, AMARELO, string);
  808.     } else {
  809.         format(string, sizeof(string), "PM do(a) admin %s: %s", PlayerName(playerid), msg);
  810.         MSGPlayer(id, AMARELO, string);
  811.         format(string, sizeof(string), "PM enviada para %s", PlayerName(id));
  812.         MSGPlayer(playerid, AMARELO, string);
  813.     }
  814.     return 1;
  815. }
  816.  
  817. YCMD:ffs(playerid, params[], help)
  818. {
  819.     if(PlayerInfo[playerid][Admin] < 3)
  820.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  821.     new fsname[30], string[60];
  822.     if(sscanf(params, "s[30]", fsname))
  823.         return MSGPlayer(playerid, CINZA, "Utilize /ffs [NOME DO FS]");
  824.     format(string, sizeof(string), "unloadfs %s", fsname);
  825.     SendRconCommand(string);
  826.     format(string, sizeof(string), "O FS %s foi descarregado. *Confira*", fsname);
  827.     MSGPlayer(playerid, VERMELHO, string);
  828.     return 1;
  829. }
  830.  
  831. YCMD:afs(playerid, params[], help)
  832. {
  833.     if(PlayerInfo[playerid][Admin] < 3)
  834.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  835.     new fsname[30], string[60];
  836.     if(sscanf(params, "s[30]", fsname))
  837.         return MSGPlayer(playerid, CINZA, "Utilize /afs [NOME DO FS]");
  838.     format(string, sizeof(string), "loadfs %s", fsname);
  839.     SendRconCommand(string);
  840.     format(string, sizeof(string), "O FS %s foi carregado. *Confira*", fsname);
  841.     MSGPlayer(playerid, VERMELHO, string);
  842.     return 1;
  843. }
  844.  
  845. YCMD:kick(playerid, params[], help)
  846. {
  847.     if(PlayerInfo[playerid][Admin] < 1)
  848.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  849.     new id, motivo[60], string[126];
  850.     if(sscanf(params, "us[60]", id, motivo))
  851.         return MSGPlayer(playerid, CINZA, "Utilize /kick [ID] [MOTIVO]");
  852.     if(!IsPlayerConnected(id))
  853.         return MSGPlayer(playerid, CINZA, "Este player não está conectado!");
  854.     if(PlayerInfo[id][Admin] == 3)
  855.         return MSGPlayer(playerid, CINZA, "Você não pode kicar um admin nivel 3!");
  856.     format(string, sizeof(string), "MFAdmin: Player %s[%d] foi kicado pelo admin %s. Motivo: %s", PlayerName(id), id, PlayerName(playerid), motivo);
  857.     MSGAll(VERMELHO, string);
  858.     KickP(id);
  859.     return 1;
  860. }
  861.  
  862. YCMD:ban(playerid, params[], help)
  863. {
  864.     if(PlayerInfo[playerid][Admin] < 2)
  865.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  866.     new id, motivo[60], string[126];
  867.     if(sscanf(params, "us[60]", id, motivo))
  868.         return MSGPlayer(playerid, CINZA, "Utilize /ban [ID] [MOTIVO]");
  869.     if(PlayerInfo[id][Admin] == 3)
  870.         return MSGPlayer(playerid, CINZA, "Você não pode banir um admin nivel 3!");
  871.     if(!IsPlayerConnected(id))
  872.         return MSGPlayer(playerid, CINZA, "Este player não está conectado!");
  873.     format(string, sizeof(string), "MFAdmin: Player %s[%d] foi banido pelo admin %s. Motivo: %s", PlayerName(id), id, PlayerName(playerid), motivo);
  874.     MSGAll(VERMELHO, string);
  875.     BanPlayer(id, PlayerName(playerid), motivo);
  876.     return 1;
  877. }
  878.  
  879. YCMD:desban(playerid, params[], help)
  880. {
  881.     if(PlayerInfo[playerid][Admin] < 2)
  882.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  883.     new ip[16];
  884.     if(sscanf(params, "s[16]", ip))
  885.         return MSGPlayer(playerid, CINZA, "Utilize /desban [IP]");
  886.     DesbanPlayer(playerid, ip);
  887.     return 1;
  888. }
  889.  
  890. YCMD:daradmin(playerid, params[], help)
  891. {
  892.     new id, nivel, string[60];
  893.     if(!IsPlayerAdmin(playerid))
  894.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  895.     if(sscanf(params, "ud", id, nivel))
  896.         return MSGPlayer(playerid, CINZA, "Utilize /daradmin [ID] [NIVEL]");
  897.     if(!IsPlayerConnected(id))
  898.         return MSGPlayer(playerid, CINZA, "Este player não está conectado!");
  899.     if(nivel > 3 || nivel < 1)
  900.         return MSGPlayer(playerid, CINZA, "O nivel não pode ser menor que 1 ou maior que 3!");
  901.     PlayerInfo[id][Admin] = nivel;
  902.     format(string, sizeof(string), "Você deu admin nivel %d para o player %s.", nivel, PlayerName(id));
  903.     MSGPlayer(playerid, VERDE, string);
  904.     format(string, sizeof(string), "O Admin %s lhe deu admin nivel %d.", PlayerName(playerid), nivel);
  905.     MSGPlayer(id, VERDE, string);
  906.     return 1;
  907. }
  908.  
  909. YCMD:tiraradmin(playerid, params[], help)
  910. {
  911.     if(!IsPlayerAdmin(playerid))
  912.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  913.     new id, string[60];
  914.     if(sscanf(params, "u", id))
  915.         return MSGPlayer(playerid, CINZA, "Utilize /tiraradmin [ID]");
  916.     if(!IsPlayerConnected(id))
  917.         return MSGPlayer(playerid, CINZA, "Este player não está conectado!");
  918.     if(PlayerInfo[id][Admin] < 1)
  919.         return MSGPlayer(playerid, CINZA, "O player não é um admin!");
  920.     PlayerInfo[id][Admin] = 0;
  921.     format(string, sizeof(string), "Você tirou o admin do player %s.", PlayerName(id));
  922.     MSGPlayer(playerid, VERDE, string);
  923.     format(string, sizeof(string), "O admin %s tirou o seu cargo de administrador.", PlayerName(playerid));
  924.     MSGPlayer(id, VERDE, string);
  925.     return 1;
  926. }
  927.  
  928. YCMD:a(playerid, params[], help)
  929. {
  930.     if(PlayerInfo[playerid][Admin] < 1)
  931.         return MSGPlayer(playerid, CINZA, "Você não tem permição para usar esse comando!");
  932.     new msg[60], string[128];
  933.     if(sscanf(params, "s[60]", msg))
  934.         return MSGPlayer(playerid, CINZA, "Utilize /a [MENSSAGEM]");
  935.     format(string, sizeof(string), "Admin %s: %s", PlayerName(playerid), msg);
  936.     AdminChat(playerid, ROSA,string);
  937.     return 1;
  938. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement