dcmd_banacc(playerid,params[]) {
if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,"| ERRO |: O comando digitado nгo Existe!");
if(strlen(params) < 3) return SendClientMessage(playerid,red,"USO: /banacc [NICK]");
if(IsIllegalName(params)) return SendClientMessage(playerid,red,"| ERRO |: Nick ilegal");
if(!udb_Exists(params)) return SendClientMessage(playerid,red,"| ERRO |: A conta nгo existe");
if(PlayerInfo[playerid][Level] < 5){if(dUserINT(params).("level") >= 1) return SendClientMessage(playerid,red,"| ERRO |: A conta pertence a um ADMIN");}
if(dUserINT(params).("banned") == 1) return SendClientMessage(playerid,red,"| ERRO |: A conta ja esta banida");
dUserSetINT(params).("banned",1);
new SampDotBan[128],file[255];
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(params));
new tmp2[256]; tmp2 = dini_Get(file,"ip");
format(SampDotBan,sizeof(SampDotBan),"banip %s", tmp2);
SendRconCommand(SampDotBan);
SendRconCommand("reloadbans");
if(dUserINT(params).("banned") == 1){
CMDMessageToAdmins(playerid,"BANACC");
//--------------- LOGAR
new ADMNAME[MAX_PLAYER_NAME];GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME);
new logstring[128];format(logstring, sizeof(logstring), "%s baniu a CONTA e IP de %s", ADMNAME,params);
SaveToFile("BannedAccs",logstring);
//---------------
SendClientMessage(playerid,blue,"A conta e o IP associado foram banidos com sucesso!");
}else{
SendClientMessage(playerid,blue,"Erro ao banir a conta");}
return 1;}
dcmd_banacc(playerid,params[]) { if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,"| ERRO |: O comando digitado nгo Existe!"); if(strlen(params) < 3) return SendClientMessage(playerid,red,"USO: /banacc [NICK]"); if(IsIllegalName(params)) return SendClientMessage(playerid,red,"| ERRO |: Nick ilegal"); if(!udb_Exists(params)) return SendClientMessage(playerid,red,"| ERRO |: A conta nгo existe"); if(PlayerInfo[playerid][Level] < 5){if(dUserINT(params).("level") >= 1) return SendClientMessage(playerid,red,"| ERRO |: A conta pertence a um ADMIN");} if(dUserINT(params).("banned") == 1) return SendClientMessage(playerid,red,"| ERRO |: A conta ja esta banida"); dUserSetINT(params).("banned",1); new SampDotBan[128],file[255]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(params)); new tmp2[256]; tmp2 = dini_Get(file,"ip"); format(SampDotBan,sizeof(SampDotBan),"banip %s", tmp2); SendRconCommand(SampDotBan); SendRconCommand("reloadbans"); if(dUserINT(params).("banned") == 1){ CMDMessageToAdmins(playerid,"BANACC"); //--------------- LOGAR new ADMNAME[MAX_PLAYER_NAME];GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME); new logstring[128];format(logstring, sizeof(logstring), "%s baniu a CONTA e IP de %s", ADMNAME,params); SaveToFile("BannedAccs",logstring); //--------------- SendClientMessage(playerid,blue,"A conta e o IP associado foram banidos com sucesso!"); new frm[60]; format(frm,sizeof(frm),"| ADMIN | O(a) Administrador(a) %s baniu o(a) Jogador(a) %s.",ADMNAME,params); SendClientMessageToAll(0xFFFFFFFF,frm); }else{ SendClientMessage(playerid,blue,"Erro ao banir a conta");} return 1;}
Код:
dcmd_banacc(playerid,params[]) { if(PlayerInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,"| ERRO |: O comando digitado nгo Existe!"); if(strlen(params) < 3) return SendClientMessage(playerid,red,"USO: /banacc [NICK]"); if(IsIllegalName(params)) return SendClientMessage(playerid,red,"| ERRO |: Nick ilegal"); if(!udb_Exists(params)) return SendClientMessage(playerid,red,"| ERRO |: A conta nгo existe"); if(PlayerInfo[playerid][Level] < 5){if(dUserINT(params).("level") >= 1) return SendClientMessage(playerid,red,"| ERRO |: A conta pertence a um ADMIN");} if(dUserINT(params).("banned") == 1) return SendClientMessage(playerid,red,"| ERRO |: A conta ja esta banida"); dUserSetINT(params).("banned",1); new SampDotBan[128],file[255]; format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(params)); new tmp2[256]; tmp2 = dini_Get(file,"ip"); format(SampDotBan,sizeof(SampDotBan),"banip %s", tmp2); SendRconCommand(SampDotBan); SendRconCommand("reloadbans"); if(dUserINT(params).("banned") == 1){ CMDMessageToAdmins(playerid,"BANACC"); //--------------- LOGAR new ADMNAME[MAX_PLAYER_NAME];GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME); new logstring[128];format(logstring, sizeof(logstring), "%s baniu a CONTA e IP de %s", ADMNAME,params); SaveToFile("BannedAccs",logstring); //--------------- SendClientMessage(playerid,blue,"A conta e o IP associado foram banidos com sucesso!"); new frm[60]; format(frm,sizeof(frm),"| ADMIN | O(a) Administrador(a) %s baniu o(a) Jogador(a) %s.",ADMNAME,params); SendClientMessageToAll(0xFFFFFFFF,frm); }else{ SendClientMessage(playerid,blue,"Erro ao banir a conta");} return 1;} |
format(frm,sizeof(frm),"| ADMIN | O(a) Administrador(a) %s baniu o(a) Jogador(a) %s.",ADMNAME,params);
format(frm,sizeof(frm),"| ADMIN | O(a) Administrador(a) %s baniu o(a) Jogador(a) %s pelo motivo %s.",ADMNAME,params,SUAVARIAVELDEMOTIVOAQUI);