[PEDIDO] /unban
#1

Boas

Necessitava um comando /unban para seguinte codigo:

Alguem podera ajudar por favor?

Sistema CRP_Scriptfiles

pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[Comando:] /ban [playerid/ParteDoNome] [Razгo]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if (PlayerInfo[playerid][pAdmin] >= 10)
                {
                    if(IsPlayerConnected(giveplayerid))
                    {
                        if(giveplayerid != INVALID_PLAYER_ID)
                        {
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' '))
                            {
                                idx++;
                            }
                            new offset = idx;
                            new result[128];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                            {
                                result[idx - offset] = cmdtext[idx];
                                idx++;
                            }
                            result[idx - offset] = EOS;
                            if(!strlen(result))
                            {
                                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[Comandos:] /ban [playerid/ParteDoNome] [Razгo]");
                                return 1;
                            }
                            BanPlayerAccount(giveplayerid,GetPlayerNameEx(playerid),(result));
                            BanPlayer(giveplayerid,GetPlayerNameEx(playerid),(result));
                            Kick(giveplayerid);
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[AVISO:] Invalido ID.");
                }
            }
            return 1;
        }
Reply
#2

Dк uma olhada na minha assinatura ; )
Reply
#3

Boas Viniborn
Problema e que nao queria mudar o sistema bans do gamemode mas sim sу acrescentar /unban
Reply
#4

Й provбvel que ao banir um jogador, seja criado um arquivo com o nome dele.

Verifique se й isso mesmo, e se for, basta deletar tal arquivo...

Qual gerenciador de arquivos vocк usa?
Reply
#5

Pega como base entao!
Reply
#6

Texto: 6.84.7.56 [26/03/12 | 17:59:20] Sergio_Patricio- INGAME BAN

Pasta: samp.ban
Reply
#7

ninguem consegue ajudar me?
Reply
#8

Posta essas funзхes aqui

BanPlayerAccount
BanPlayer
Reply
#9

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Posta essas funзхes aqui

BanPlayerAccount
BanPlayer
pawn Код:
public BanPlayerAccount(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"[Server] %s foi Account-Banned por %s, Motivo: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAll(COLOR_ADMINCMD,string);
    AccountBanLog(string);
    PlayerInfo[playerid][pBanned] = 1;
    OnPlayerDataSave(playerid);
    return 1;
}
//--------------------------------------------------------------------
public BanPlayer(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"[Server] %s foi banido por %s, Motivo: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAll(COLOR_ADMINCMD,string);
    BanLog(string);
    return Ban(playerid);
}
Reply
#10

pawn Код:
if(strcmp(cmd, "/unban", true) == 0)
        {
            if(IsPlayerDisconnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[Comando:] /unban [playerid/ParteDoNome] [Razгo]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if (PlayerInfo[playerid][pAdmin] >= 10)
                {
                    if(IsPlayerDisconnected(giveplayerip))
                    {
                        if(giveplayerip != MAX_PLAYER_IP)
                        {
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' '))
                            {
                                idx++;
                            }
                            new offset = idx;
                            new result[128];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                            {
                                result[idx - offset] = cmdtext[idx];
                                idx++;
                            }
                            result[idx - offset] = EOS;
                            if(!strlen(result))
                            {
                                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[Comandos:] /unban [playerid/ParteDoNome] [Razгo]");
                                return 1;
                            }
                            UnBanPlayerAccount(giveplayerip,GetPlayerNameEx(playerip),(result));
                            UnBanPlayer(giveplayerip,GetPlayerNameEx(playerip),(result));
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[AVISO:] Invalido ID.");
                }
            }
            return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)