[Pedido] Comando por nick
#1

Galera,й o seguinte,estou sofrendo com ataque hacker,e preciso de um comando de banir,que sу um nick setado possa usar sem estar logado na rcon nem nada....
Tipo,preciso que sу o nick "ShakaL" use esse comando,sem precisar ta logado na rcon nem nada...
Alguem pode me ajuda?
Rep+


Й tipo isso,mas esse й o comando de ban comum de adm
Код:
if(strcmp(cmd, "/ban", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
}else{
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || %d-%d-%d", aname, pname,result,month,day,year);
BanLog(string);
SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins!");
GameTextForPlayer(plid,"~r~banido", 2500, 3);
format(string, sizeof(string), "{00FF00}(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
SendClientMessageToAll(tcadm, string);
dini_IntSet("banidos.ini",pname,1);
Ban(plid);
}
}else{
format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}
Reply
#2

Coloque um sistema de admins no teu serve e no comando /ban coloque isso.

Код:
	{
	GetPlayerName(playerid, sendername, 256);
 	if (strcmp(sendername,"NICK",true)==0 || strcmp(sendername,"NICK",true)==0 || strcmp(sendername,"NICK",true)==0)
 	{
Onde esta NICK coloque o nick dos players que poderгo usar o comando.
E se for ataque por ping(akeles que o pessoal vai no cmd e poing [ip]) recomendo que voce crie uma regra no firewall do windows para o pc nao responder a ping.Seja feliz
Reply
#3

ver o se da esse comando pra vocк e so trocar meu nick :
pawn Код:
if(strcmp(cmd, "/ban", true) == 0) {
if (strcmp(sendername,"Troll_Face",true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
}else{
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || %d-%d-%d", aname, pname,result,month,day,year);
BanLog(string);
SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins!");
GameTextForPlayer(plid,"~r~banido", 2500, 3);
format(string, sizeof(string), "{00FF00}(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
SendClientMessageToAll(tcadm, string);
dini_IntSet("banidos.ini",pname,1);
Ban(plid);
}
}else{
format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}
Reply
#4

pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(!strcmp(aname,"ShakaL",true))
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
            return 1;
        }
        plid = strval(tmp);
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        format(file2, sizeof(file2), PASTA_CONTAS, pname);
        if(IsPlayerConnected(plid)){
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[64];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result))
        {
            SendClientMessage(playerid, Vermelho, "Uso: /banir [id] [motivo]");
        }
        else
        {
            new year, month,day;
            getdate(year, month, day);
            format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || %d-%d-%d", aname, pname,result,month,day,year);
            BanLog(string);
            SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
            SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins!");
            GameTextForPlayer(plid,"~r~banido", 2500, 3);
            format(string, sizeof(string), "{00FF00}(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname,pname,result);
            SendClientMessageToAll(tcadm, string);
            dini_IntSet("banidos.ini",pname,1);
            Ban(plid);
        }
    }
    else
    {
        format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
        SendClientMessage(playerid, Vermelho, string);
    }
}
    return true;
}
._.'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)