Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include SII
- #include zcmd
- #include sscanf
- #define DIALOG_REGISTRO 1
- #define DIALOG_LOGAR 2
- #define coradm 0x00E87FAA
- #define cor1 0x48FF88AA
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" a_Admin, Feito Por João Victor");
- print("--------------------------------------\n");
- return 1;
- }
- #else
- #endif
- new
- texto[10],
- nome[MAX_PLAYER_NAME],
- Str[128],
- ip[16],
- id,
- grana,
- score,
- score1,
- skin;
- new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
- enum pInfo
- {
- pSenha,
- pScore,
- pDinheiro,
- pAdmin
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- stock ObterINI(playerid)
- {
- new conta[64];
- format(conta,30,"Contas/%s.ini",gPlayerName[playerid]);
- return conta;
- }
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
- if (fexist(ObterINI(playerid))) {
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT,"Login","Digite sua senha abaixo para efetuar login.","logar","Sair");
- }
- else {
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT,"Registrando","Digite sua senha abaixo para registrar uma nova conta.","Registrar","Sair");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch( dialogid ) {
- case DIALOG_REGISTRO:
- {
- if (!response) return Kick(playerid);
- if (response) {
- if(!strlen(inputtext)) {
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro","Você digitou uma senha inválida.\nDigite sua senha abaixo para registrar uma nova conta.","Registro","Sair");
- }
- if(INI_Open(ObterINI(playerid))) {
- INI_WriteString("Senha",inputtext);
- INI_WriteInt("Score",1);
- INI_WriteInt("Dinheiro",5000);
- INI_WriteInt("Admin",0);
- INI_Save();
- INI_Close();
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT,"Logar","Digite sua senha abaixo para efetuar login:","Logar","Sair");
- }
- }
- }
- case DIALOG_LOGAR:
- {
- if ( !response ) return Kick ( playerid );
- if( response ) {
- if(!strlen(inputtext)) {
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT, "Logar","Você digitou uma senha inválida.\nDigite sua senha abaixo para efetuar login:","Logar","Sair");
- }
- if(INI_Open(ObterINI(playerid))) {
- INI_ReadString(PlayerInfo[playerid][pSenha],"Senha",20);
- if(strcmp(inputtext,PlayerInfo[playerid][pSenha],false)) {
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT, "Logar","Você digitou uma senha incorreta.\nDigite sua senha abaixo para efetuar login:","Logar","Sair");
- }
- SetPlayerScore(playerid, INI_ReadInt("Score" ) );
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, INI_ReadInt( "Dinheiro" ));
- PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
- INI_Close();
- SpawnPlayer(playerid);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(INI_Open(ObterINI(playerid))) {
- INI_WriteInt("Score",PlayerInfo[playerid][pScore]);
- INI_WriteInt("Dinheiro",GetPlayerMoney(playerid));
- INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Save();
- INI_Close();
- }
- return 1;
- }
- CMD:kick(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "us",id,texto)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/kick [id] [motivo]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- SendClientMessage(id,cor1,"Você foi kickado,volte no servidor e não cometa o mesmo erro.");
- Kick(id);
- ResetPlayerWeapons(id);
- ResetPlayerMoney(id);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Info: {FFFFFF}%s foi kickado [ Motivo: %s ].",nome,texto);
- SendClientMessageToAll(cor1,Str);
- return 1;
- }
- CMD:ban(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "us",id,texto)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/ban [id] [motivo]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- SendClientMessage(id,cor1,"Você foi banido, se for inocente relate no forum.");
- Ban(id);
- ResetPlayerWeapons(id);
- ResetPlayerMoney(id);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Info: {FFFFFF}%s foi banido [ Motivo: %s ].",nome,texto);
- SendClientMessageToAll(cor1,Str);
- return 1;
- }
- CMD:aviso(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "us",id,texto)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/aviso [id] [motivo]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- GetPlayerName(id,nome,sizeof(nome));
- GameTextForPlayer(id,"AVISO",1500,1);
- format(Str, sizeof(Str), "Aviso: %s [ Motivo: %s ]",nome,texto);
- SendClientMessageToAll(cor1,Str);
- return 1;
- }
- CMD:an(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "us",id,texto)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/an [texto]");
- GetPlayerName(playerid,nome,sizeof(nome));
- format(Str, sizeof(Str), "Administrador: %s || s% ||",nome,texto);
- SendClientMessageToAll(cor1,Str);
- return 1;
- }
- CMD:congelar(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/congelar [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- TogglePlayerControllable(id,0);
- SendClientMessage(playerid,coradm,"Você foi congelado.");
- return 1;
- }
- CMD:descongelar(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/descongelar [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- TogglePlayerControllable(id,1);
- SendClientMessage(playerid,coradm,"Você foi descongelado.");
- return 1;
- }
- CMD:ejetar(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/ejetar [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- RemovePlayerFromVehicle(id);
- SendClientMessage(playerid,cor1,"Você foi ejetado de seu veiculo.");
- return 1;
- }
- CMD:ip(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/ip [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- GetPlayerIp(id,ip,sizeof(ip));
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "iP: %s || d% ||",nome,ip);
- SendClientMessage(playerid,cor1,Str);
- return 1;
- }
- CMD:ir(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/ir [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(playerid,x,y+2, z);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Admin [ %s ] se teleportou até você.",nome);
- SendClientMessage(id,cor1,Str);
- return 1;
- }
- CMD:trazer(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "u",id)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/trazer [id]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(id,x,y+2, z);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Admin [ %s ] se levou você até ele.",nome);
- SendClientMessage(id,cor1,Str);
- return 1;
- }
- CMD:setskin(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "iu",id,skin)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/darskin [id] [skinid]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- if(skin > 299 || skin < 1) return SendClientMessage(playerid, 0xFF0000FF, "ERRO: ID inválido!");
- SetPlayerSkin(id,skin);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Você deu para o player %s a skin de id: d% ",nome,skin);
- SendClientMessage(playerid,cor1,Str);
- return 1;
- }
- CMD:dargrana(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "iu",id,grana)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/dargrana [id] [grana]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- if(grana > 40000 || grana < 1) return SendClientMessage(playerid, 0xFF0000FF, "ERRO: Quantidade inválida. Max: 40000");
- GivePlayerMoney(id,grana);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Você deu %d para o player %s ",grana,nome);
- SendClientMessage(playerid,cor1,Str);
- return 1;
- }
- CMD:darscore(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- if(sscanf(params, "iu",id,score1)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/darscore [id] [score]");
- if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este playerid não está conectado.");
- if(grana > 400 || grana < 1) return SendClientMessage(playerid, 0xFF0000FF, "ERRO: Quantidade inválida. Max: 400");
- score = GetPlayerScore(id);
- SetPlayerScore(id,score+score1);
- GetPlayerName(id,nome,sizeof(nome));
- format(Str, sizeof(Str), "Você deu %d scores para o player %s ",score1,nome);
- SendClientMessage(playerid,cor1,Str);
- return 1;
- }
- CMD:daradmin(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid,coradm,"Você não é administrador lvl2.");
- new lvl[50];
- if(sscanf(params, "iu",id,lvl)) return SendClientMessage(playerid,coradm,"Use: {FFFFFF}/daradmin [id] [lvl(1a2)]");
- if(INI_Open(ObterINI(id)))
- {
- INI_WriteString("Admin",lvl);
- }
- return 1;
- }
- CMD:aa(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid,coradm,"Você não é administrador.");
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"{0F64A5}Ajuda Admin","{9BABB7}/kick(lvl1), /ban(lvl1), /ir(lvl1), /trazer(lvl1), /ip\n/darscore(lvl2), /dargrana(lvl2), /setskin(lvl2), /daradmin(lvl2), /ejetar(lvl2), /congelar(lvl1)\n/descongelar(lvl1), /an(lvl1), /aviso(lvl1)","Ok","Fechar");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment