dcmd_banirconta(playerid,params[]) {
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,"| ERRO | Comando Inexistente.");
if(strlen(params) < 3) return SendClientMessage(playerid,red,"| ERRO | Digite: /banirconta [Nick do Jogador(a)]");
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 membro da Administraзгo!");}
if(dUserINT(params).("banned") == 1) return SendClientMessage(playerid,red,"| ERRO | A Conta jб permanece 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,"banirconta");
//--------------- LOGAR
new ADMNAME[MAX_PLAYER_NAME];GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME);
new logstring[128];format(logstring, sizeof(logstring), "| BAN-LOG | O(A) Admin(a) %s baniu a conta do(a) Jogador(a): (%s)", ADMNAME,params);
SaveToFile("BannedAccs",logstring);
//---------------
SendClientMessage(playerid,azul,"A conta e o IP foi banidas com Sucesso!");
new frm[260];
new motivo[250];
new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
format(frm,sizeof(frm),"| BVD-Admin | O(A) Administrador(a) %s baniu a conta do(a) jogador(a) %s",ADMNAME,params,motivo[2],day,month,year,hour,minuite);
SendClientMessageToAll(red,frm);
}else{
SendClientMessage(playerid,red,"| ERRO | Nгo й possivel banir a conta!");}
return 1;}
dcmd_banirconta(playerid,params[]) {
new motivo[250]; //mudei isso
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,"| ERRO | Comando Inexistente.");
if(sscanf(params, "ss",params, motivo)) return Msg(playerid, 0xFF0000FF, "Erro digite /banirconta [Nick do Jogador(a) [ Motivo ]"); //mudei isso
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 membro da Administraзгo!");}
if(dUserINT(params).("banned") == 1) return SendClientMessage(playerid,red,"| ERRO | A Conta jб permanece 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,"banirconta");
//--------------- LOGAR
new ADMNAME[MAX_PLAYER_NAME];GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME);
new logstring[128];format(logstring, sizeof(logstring), "| BAN-LOG | O(A) Admin(a) %s baniu a conta do(a) Jogador(a): (%s)", ADMNAME,params);
SaveToFile("BannedAccs",logstring);
//---------------
SendClientMessage(playerid,azul,"A conta e o IP foi banidas com Sucesso!");
new frm[260];
new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
format(frm,sizeof(frm),"| BVD-Admin | O(A) Administrador(a) %s baniu a conta do(a) jogador(a) %s Motivo %s",ADMNAME,params,motivo,day,month,year,hour,minuite); //mudei isso
SendClientMessageToAll(red,frm);
}else{
SendClientMessage(playerid,red,"| ERRO | Nгo й possivel banir a conta!");}
return 1;}
dcmd_banirconta(playerid,params[])
{
new motivo[50],Nick[24]; //mudei isso
if(PlayerInfo[playerid][Level] < 2)
return SendClientMessage(playerid,red,"| ERRO | Comando Inexistente.");
if(sscanf(params, "s[24]s[50]",Nick, motivo))
return Msg(playerid, 0xFF0000FF, "Erro digite /banirconta [Nick do Jogador(a) [ Motivo ]"); //mudei isso
if(IsIllegalName(Nick))
return SendClientMessage(playerid,red,"| ERRO | Nick ilegal!");
if(!udb_Exists(Nick))
return SendClientMessage(playerid,red,"| ERRO | A conta nгo Existe!");
if(PlayerInfo[playerid][Level] < 5){if(dUserINT(Nick).("level") >= 1)
return SendClientMessage(playerid,red,"| ERRO | A conta pertence a um membro da Administraзгo!");}
if(dUserINT(Nick).("banned") == 1)
return SendClientMessage(playerid,red,"| ERRO | A Conta jб permanece Banida!");
dUserSetINT(Nick).("banned",1);
new SampDotBan[48],file[50];
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(Nick));
new tmp2[20];
tmp2 = dini_Get(file,"ip");
format(SampDotBan,sizeof(SampDotBan),"banip %s", tmp2);
SendRconCommand(SampDotBan);
SendRconCommand("reloadbans");
if(dUserINT(Nick).("banned") == 1){
CMDMessageToAdmins(playerid,"banirconta");
//--------------- LOGAR
static ADMNAME[MAX_PLAYER_NAME];
GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME);
new logstring[95];
format(logstring, sizeof(logstring), "| BAN-LOG | O(A) Admin(a) %s baniu a conta do(a) Jogador(a): (%s)", ADMNAME,Nick);
SaveToFile("BannedAccs",logstring);
//---------------
SendClientMessage(playerid,azul,"A conta e o IP foi banidas com Sucesso!");
new frm[150];
new year,month,day,hour,minuite,second;
getdate(year, month, day);
gettime(hour,minuite,second);
format(frm,sizeof(frm),"| BVD-Admin | O(A) Administrador(a) %s baniu a conta do(a) jogador(a) %s Motivo %s",ADMNAME,Nick,motivo,day,month,year,hour,minuite); //mudei isso
SendClientMessageToAll(red,frm);
}else{
SendClientMessage(playerid,red,"| ERRO | Nгo й possivel banir a conta!");
}
return 1;
}
Eu faria assim.
obs:Eu editei o cуdigo do lHesoyaml. PHP код:
|
C:\Users\Pedro Tramontina\Desktop\Projeto SA-MP\filterscripts\ladmin4v2.pwn(2193) : error 017: undefined symbol "sscanf"
C:\Users\Pedro Tramontina\Desktop\Projeto SA-MP\filterscripts\ladmin4v2.pwn(2194) : error 017: undefined symbol "Msg"
C:\Users\Pedro Tramontina\Desktop\Projeto SA-MP\filterscripts\ladmin4v2.pwn(2207) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
dcmd_banirconta(playerid,params[])
{
new motivo[50],Nick[24]; //mudei isso
if(PlayerInfo[playerid][Level] < 2)
return SendClientMessage(playerid,red,"| ERRO | Comando Inexistente.");
if(sscanf(params, "s[24]s[50]",Nick, motivo))
return SendClientMessage(playerid, 0xFF0000FF, "Erro digite /banirconta [Nick do Jogador(a) [ Motivo ]"); //mudei isso
if(IsIllegalName(Nick))
return SendClientMessage(playerid,red,"| ERRO | Nick ilegal!");
if(!udb_Exists(Nick))
return SendClientMessage(playerid,red,"| ERRO | A conta nгo Existe!");
if(PlayerInfo[playerid][Level] < 5){if(dUserINT(Nick).("level") >= 1)
return SendClientMessage(playerid,red,"| ERRO | A conta pertence a um membro da Administraзгo!");}
if(dUserINT(Nick).("banned") == 1)
return SendClientMessage(playerid,red,"| ERRO | A Conta jб permanece Banida!");
dUserSetINT(Nick).("banned",1);
new SampDotBan[128],file[128];
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(Nick));
new tmp2[50];
tmp2 = dini_Get(file,"ip");
format(SampDotBan,sizeof(SampDotBan),"banip %s", tmp2);
SendRconCommand(SampDotBan);
SendRconCommand("reloadbans");
if(dUserINT(Nick).("banned") == 1){
CMDMessageToAdmins(playerid,"banirconta");
//--------------- LOGAR
static ADMNAME[MAX_PLAYER_NAME];
GetPlayerName(playerid, ADMNAME, MAX_PLAYER_NAME);
new logstring[95];
format(logstring, sizeof(logstring), "| BAN-LOG | O(A) Admin(a) %s baniu a conta do(a) Jogador(a): (%s)", ADMNAME,Nick);
SaveToFile("BannedAccs",logstring);
//---------------
SendClientMessage(playerid,azul,"A conta e o IP foi banidas com Sucesso!");
new frm[150];
new year,month,day,hour,minuite,second;
getdate(year, month, day);
gettime(hour,minuite,second);
format(frm,sizeof(frm),"| BVD-Admin | O(A) Administrador(a) %s baniu a conta do(a) jogador(a) %s Motivo %s",ADMNAME,Nick,motivo,day,month,year,hour,minuite); //mudei isso
SendClientMessageToAll(red,frm);
}else{
SendClientMessage(playerid,red,"| ERRO | Nгo й possivel banir a conta!");
}
return 1;
}