Uso a rban da lethaL й quando da rban aparece que cai a conexгo do player, oque ta errado no code?
Код:
dcmd_rban(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"[ERRO]: Vocк nгo tem permissгo para isso");
if(PlayerInfo[playerid][Level] >= 7 || IsPlayerAdmin(playerid)) {
new ip[128], tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USO: /rban [playerid] [Motivo]");
if(!strlen(tmp2)) return SendClientMessage(playerid, red, "[ERRO]: Voce deve especificar um motivo");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[140];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
CMDMessageToAdmins(playerid,"RBAN");
format(string,sizeof(string),"%s foi banido em range por %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
SendClientMessageToAll(grey,string);
SaveToFile("BanLog",string);
print(string);
if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1);
GetPlayerIp(player1,ip,sizeof(ip));
strdel(ip,strlen(ip)-2,strlen(ip));
format(ip,128,"%s**",ip);
format(ip,128,"banip %s",ip);
SendRconCommand(ip);
return 1;
} else return SendClientMessage(playerid, red, "Jogador nao esta conectado ou e vocк mesmo ou admin de alto nivel");
} else return SendClientMessage(playerid,red,"[ERRO]: Vocк nгo tem permissгo para isso");
} else return SendClientMessage(playerid,red,"[ERRO]: Voce deve estar logado para usar estes comandos");
}