#include #define COR_ALPHA 0x00C7FFAA #define COR_BRAVO 0xAA3333AA #define COR_BRANCO 0xFFFFFFAA #define COR_AMARELOCLARO 0xFEEE66AA #define COR_VERMELHO 0xAA3333AA #define COR_JFVERDE 0x7FFF00AA #define COR_ROSA 0xFF00FFAA #if defined FILTERSCRIPT #endif //------------------------------------------------- strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; } //------------------------------------------------- public OnFilterScriptInit() { print(" MAdmin Script Carregado"); SetTimer("VeiculoRespawn", 10*60*1000, true); return 1; } //------------------------------------------------- public OnFilterScriptExit() { print(" MAdmin Script Descarregado"); return 1; } //-------------------------------------------------- stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); return name; } //-------------------------------------------------- //------------------------------------------------- public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if(!strcmp(cmd, "/acomandos", true)) if(IsPlayerAdmin(playerid)){ new tmp[256], pagina; tmp = strtok(cmdtext, idx); pagina = strval(tmp); if(!strlen(tmp))return SendClientMessage(playerid, COR_VERMELHO, "USE: /acomandos [1-3]"); if(pagina == 1) { SendClientMessage(playerid, COR_JFVERDE, "Comandos de Administradores."); SendClientMessage(playerid, COR_BRANCO, "/matar [id] : Mata um jogador."); SendClientMessage(playerid, COR_BRANCO, "/ir [id-destino] : Vai até algum player."); SendClientMessage(playerid, COR_BRANCO, "/trazer [id] : Traz algum player até você."); SendClientMessage(playerid, COR_BRANCO, "/enchervida [id] : Enche a vida de um jogador."); SendClientMessage(playerid, COR_BRANCO, "/mudarnome [id] [novo-nome] : Muda o nome de um jogador."); SendClientMessage(playerid, COR_BRANCO, "/tapa [id] : Dá um tapa em alguém fazendo ele perder vida, ajuda a ver se ele é cheater."); SendClientMessage(playerid, COR_BRANCO, "/ad [id] [quantidade] : Adiciona um quantidade de dinheiro para algum player."); SendClientMessage(playerid, COR_BRANCO, "/setarscore [id] [quantidade]: Seta alguma quantidade de score para algum player."); SendClientMessage(playerid, COR_AMARELOCLARO, "Para mais comandos de adminstradores, escreva /acomandos2."); } else if(pagina == 2) { SendClientMessage(playerid, COR_JFVERDE, "Comandos de Administradores - Parte 2."); SendClientMessage(playerid, COR_BRANCO, "/kickar [id] [motivo] : Kicka alguém do servidor."); SendClientMessage(playerid, COR_BRANCO, "/banir [id] [motivo] : Chuta alguém do servidor."); SendClientMessage(playerid, COR_BRANCO, "/paralisar [id]: Paralisa algum jogador."); SendClientMessage(playerid, COR_BRANCO, "/desparalisar [id]: Desparalisa algum jogador."); SendClientMessage(playerid, COR_BRANCO, "/ejetar [id] : Ejeta alguem de algum veiculo."); SendClientMessage(playerid, COR_BRANCO, "/desarmar [id] : Apreende as armas de algum jogador."); SendClientMessage(playerid, COR_BRANCO, "/spawnplayer [id] : Spawna o jogador."); SendClientMessage(playerid, COR_AMARELOCLARO, "Para mais comandos de adminstradores, escreva /acomandos3."); } else if(pagina == 3) { SendClientMessage(playerid, COR_JFVERDE, "Comandos de Administradores - Parte 3."); SendClientMessage(playerid, COR_BRANCO, "/kickar [id] [motivo] : Kicka alguém do servidor."); SendClientMessage(playerid, COR_BRANCO, "/banir [id] [motivo] : Bani alguém do servidor."); SendClientMessage(playerid, COR_BRANCO, "/paralisar [id]: Paralisa algum jogador."); SendClientMessage(playerid, COR_AMARELOCLARO, "Esses são os comandos de administradores."); } else { SendClientMessage(playerid, COR_VERMELHO, "Comandos de administrador de 1-3!"); } return 1; } if (strcmp(cmd, "/admin", true)==0) { new tmp[128]; new string[128]; strmid(tmp, cmdtext, 6, strlen(cmdtext)); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USO: /admin [mensagem]"); return 1; } else { format(string, sizeof(string), "[AJUDA] %s(id:%d): %s", PlayerName(playerid), playerid); SendClientMessage(playerid, COR_ALPHA, string); SendClientMessageAdmin(COR_ALPHA, string); print(string); return 1; } } if(!strcmp(cmd, "/setarscore", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; new plid; new Score; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_BRANCO, "USE: /setarscore [id] [quantidade]"); return 1; } plid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid,COR_BRANCO,"/setarscore [id] [quantidade]"); return 1; } Score = strval(tmp); if(IsPlayerConnected(plid)) { SetPlayerScore(plid, Score); format(msg,sizeof(msg),"Você setou o score de %s para %d",PlayerName(plid),GetPlayerScore(playerid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } } if(!strcmp(cmd, "/tapa", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /tapa [id]."); return 1; } new plid; plid = strval(tmp); new Float:X, Float:Y, Float:Z; GetPlayerPos(plid,X,Y,Z); SetPlayerPos(plid, X, Y, Z+10); format(msg,sizeof(msg),"Você acaba de dar um tapa em %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(strcmp(cmd,"/spcarro",true)==0) { if(IsPlayerAdmin(playerid)) { new tmp[256]; new plid; tmp = strtok(cmdtext,idx); plid = strval(tmp); if(!strlen(tmp)){ SendClientMessage(playerid, COR_VERMELHO, "Uso: /spcarro [id do motorista]."); return 1; } if(IsPlayerConnected(plid)){ if(IsPlayerInAnyVehicle(plid)){ SetVehicleToRespawn(GetPlayerVehicleID(plid)); new string[128]; format(string,sizeof(string),"%s spawnou seu veiculo.",PlayerName(playerid)); SendClientMessage(plid, COR_JFVERDE,string); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Esse jogador não está em um veiculo."); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Jogador não conectado."); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão."); return 1; } } if(strcmp(cmd,"/a",true)==0) { if(IsPlayerAdmin(playerid)) { new tmp[256]; strmid(tmp, cmdtext, 2, strlen(cmdtext)); if(!strlen(tmp)){ SendClientMessage(playerid, COR_VERMELHO, "Uso: /a [mensagem]"); return 1; } new string[128]; format(string, sizeof(string),"[ADMIN]%s:%s",PlayerName(playerid), tmp); SendClientMessageToAdmins(COR_ROSA, string); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão."); return 1; } } if(!strcmp(cmd, "/matar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /matar [id]."); return 1; } new plid; plid = strval(tmp); SetPlayerHealth(plid, 0); format(msg,sizeof(msg),"Você acaba de matar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/enchervida", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /enchervida [id]."); return 1; } new plid; plid = strval(tmp); SetPlayerHealth(plid,100); format(msg,sizeof(msg),"Você acaba de encher a vida de %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(strcmp(cmd,"/trazer",true)==0) { if(IsPlayerAdmin(playerid)) { new tmp[256]; new plid; tmp = strtok(cmdtext,idx); plid = strval(tmp); if(!strlen(tmp)){ SendClientMessage(playerid, COR_VERMELHO, "Uso: /trazer [id]."); return 1; } if(IsPlayerConnected(plid)){ new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); new string[128]; format(string,sizeof(string),"O administrador %s puxou você até ele.",PlayerName(playerid)); SendClientMessage(plid, COR_JFVERDE, string); if(!IsPlayerInAnyVehicle(plid)){ SetPlayerPos(plid,X+1,Y+1,Z+1); SetPlayerInterior(plid,GetPlayerInterior(playerid)); return 1; } else{ SetVehiclePos(GetPlayerVehicleID(plid),X,Y,Z); LinkVehicleToInterior(GetPlayerVehicleID(plid),GetPlayerInterior(playerid)); SetPlayerInterior(plid,GetPlayerInterior(playerid)); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Jogador não conectado."); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão."); return 1; } } if(strcmp(cmd,"/ir",true)==0) { if(IsPlayerAdmin(playerid)) { new tmp[256]; new plid; tmp = strtok(cmdtext,idx); plid = strval(tmp); if(!strlen(tmp)){ SendClientMessage(playerid, COR_VERMELHO, "Uso: /ir [id]."); return 1; } if(IsPlayerConnected(plid)){ new Float:X,Float:Y,Float:Z; GetPlayerPos(plid,X,Y,Z); new string[128]; format(string,sizeof(string),"O administrador %s foi até você.",PlayerName(playerid)); SendClientMessage(plid, COR_JFVERDE, string); if(!IsPlayerInAnyVehicle(playerid)){ SetPlayerPos(playerid,X+1,Y+1,Z+1); SetPlayerInterior(playerid,GetPlayerInterior(plid)); return 1; } else{ SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z); LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(plid)); SetPlayerInterior(playerid,GetPlayerInterior(plid)); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Jogador não conectado."); return 1; } } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão."); return 1; } } if(!strcmp(cmd, "/mudarnick", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; new nick[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /mudarnick [id] [nick-novo]."); return 1; } nick = strtok(cmdtext,idx); new plid; plid = strval(tmp); SetPlayerName(plid, nick); format(msg,sizeof(msg),"Você acabou de mudar o nick de %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/paralisar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /paralisar [id]."); return 1; } new plid; plid = strval(tmp); TogglePlayerControllable(plid,0); format(msg,sizeof(msg),"Você acaba de paralisar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/desparalisar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /desparalisar [id]."); return 1; } new plid; plid = strval(tmp); TogglePlayerControllable(plid,1); format(msg,sizeof(msg),"Você acaba de desparalisar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/ejetar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /ejetar [id]."); return 1; } new plid; plid = strval(tmp); RemovePlayerFromVehicle(plid); format(msg,sizeof(msg),"Você acaba de ejetar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/desarmar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /desarmar [id]."); return 1; } new plid; plid = strval(tmp); ResetPlayerWeapons(plid); format(msg,sizeof(msg),"Você acaba de desarmar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/spawnplayer", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /spawnplayer [id]."); return 1; } new plid; plid = strval(tmp); SpawnPlayer(plid); format(msg,sizeof(msg),"Você acaba de spawnar %s",PlayerName(plid)); SendClientMessage(playerid, COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/kickar", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; new motivo[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /kickar [id] [motivo]."); return 1; } motivo = strtok(cmdtext,idx); new plid; plid = strval(tmp); Kick(plid); format(msg,sizeof(msg),"O administrador %s chutou %s do servidor motivo: %s",PlayerName(playerid),PlayerName(plid),motivo); SendClientMessageToAll(COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(!strcmp(cmd, "/banir", true)) if(IsPlayerAdmin(playerid)){ new tmp[256]; new msg[128]; new motivo[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COR_VERMELHO, "USE: /banir [id] [motivo]."); return 1; } motivo = strtok(cmdtext,idx); new plid; plid = strval(tmp); Ban(plid); format(msg,sizeof(msg),"O administrador %s baniu %s do servidor motivo: %s",PlayerName(playerid),PlayerName(plid),motivo); SendClientMessageToAll(COR_JFVERDE, msg); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } if(strcmp(cmdtext, "/rpve", true) == 0) { if(IsPlayerAdmin(playerid)) { new string[128]; VeiculoRespawn(); format(string,sizeof(string),"Todos os veiculos do servidor que não estavam em uso foram respawnado pelo administrador %s",PlayerName(playerid)); SendClientMessageToAll(COR_JFVERDE, string); } else SendClientMessage(playerid, COR_VERMELHO, "Você não pode usar esse comando."); return 1; } if(!strcmp(cmd, "/ad", true)) if(IsPlayerAdmin(playerid)){ new temp[256]; new string[128]; new plid; new grana; temp = strtok(cmdtext, idx); if(!strlen(temp)) { SendClientMessage(playerid, COR_BRANCO, "USE: /ad [id] [quantia]"); return 1; } plid = strval(temp); temp = strtok(cmdtext, idx); if(!strlen(temp)) { SendClientMessage(playerid,COR_BRANCO,"/ad [id] [quantia]"); return 1; } grana = strval(temp); if(IsPlayerConnected(plid)) { GivePlayerMoney(plid, grana); format(string,sizeof(string),"Você adicionou %d reais para %s",grana,PlayerName(plid)); SendClientMessage(playerid, COR_VERMELHO, string); return 1; } else{ SendClientMessage(playerid, COR_VERMELHO, "Você não tem permissão!"); return 1; } } return 0; } stock QtAdmins(){ new result = 0; for(new i = 0; i < MAX_PLAYERS; i++){ if(IsPlayerConnected(i) && IsPlayerAdmin(i)) result++; } return result; } stock SendClientMessageAdmin(text_color, string_text[]){ for(new i=0;i