20.10.2013, 14:26
Hello Friends This is Unban CMD for Luxadmin
Put Down it "OnPlayerCommandText"
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
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); }
Use Ban(playerid);
Working I tested in my server