/unban cmd for luxadmin
#1

Hello Friends This is Unban CMD for Luxadmin
Put Down it "OnPlayerCommandText"
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        dcmd(unban,5,cmdtext);
}
Код:
dcmd_unban(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        new Index;
        new tmp[256];  tmp  = strtok(params, Index);
        new unbanname[256];
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /unban [Exact Name]") &&
        SendClientMessage(playerid, orange, "Function: Will unban the player based on Name");
        unbanname = tmp;
        new string[64];
        SendCommandToAdmins(playerid, "Unban");
        new filestring2[128];
        format(filestring2, sizeof(filestring2), "/LuxAdmin/Accounts/%s.sav", udb_encode(unbanname));
        if(!fexist(filestring2)) return SendClientMessage(playerid, 0xFF0000FF , "Account name doesn't exist!");
        //if(udb_Exists(udb_encode(unbanname)))
        udb_UserSetInt(unbanname,"Banned",0);
        format(string,sizeof(string),"You have unbanned %s", tmp);
        return SendClientMessage(playerid, blue, string);
    }
    else return ErrorMessages(playerid, 1);
}
Note:- Ban a player who currently in the server. The ban will be IP-based, and be saved in the samp.ban file in the server's root directory. BanEx allows you to ban with a reason, while you can ban and unban IPs using the RCON banip and unbanip commands.

Use Ban(playerid);
Working I tested in my server
Reply
#2

/unban cmd not available in dcmd_ ok it is only available in zcmd



Like this:
CMD:unban(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 2) {
new
string[42],nickname[50];
if(sscanf(params, "s[50]s[48]", nickname)) return SCM(playerid, -1, "USAGE: /Unban (Nickname)");

CMDMessageToAdmins(playerid,"UNBAN");
SaveToFile("BanLog",string);
return VUnBan(playerid,nickname);
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#3

its avialable in dcmd_ Try It then Post Bro
Reply
#4

in dcmd_ it is available but not work
Reply
#5

Show me the code for the dcmd_ban and show me how the file looks after doing the /unban cmd.

Any errors ingame or when compiling?
Reply
#6

Does it Unban Name and ip in same time?
Reply
#7

Quote:
Originally Posted by PAF
Посмотреть сообщение
/unban cmd not available in dcmd_ ok it is only available in zcmd



Like this:
CMD:unban(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 2) {
new
string[42],nickname[50];
if(sscanf(params, "s[50]s[48]", nickname)) return SCM(playerid, -1, "USAGE: /Unban (Nickname)");

CMDMessageToAdmins(playerid,"UNBAN");
SaveToFile("BanLog",string);
return VUnBan(playerid,nickname);
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
It is avaliable actually, and LuxAdmin already HAS an unban script, but it works with ip, look for dcmd_console, the unban option is in there.
Reply
#8

dcmd_unbanip > /unbanip ? ? ?

nice dcmd_unban
nice /unban
please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)