Quote:
Originally Posted by Ritzy
Код:
CMD:nameunban(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
new tmp[256], Index;
tmp = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /nameunban [name]");
new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
unbanname = tmp;
if(udb_Exists(unbanname))
{
dUserSetINT(unbanname).("Banned", 0);
GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"NAMEUNBAN");
SaveToFile("UnBanNameLog",string);
SendRconCommand("reloadbans");
print(string);
return 1;
}
else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
}
Tip: Use dini2 by Gammix, and use sscanf by ****** for params or use isnull
|
Код:
CMD:unban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,red, "ERROR: You are not a high enough level to use this command");
new tmp[256], Index; tmp = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /unban [name]");
new adminname[MAX_PLAYER_NAME], string[128], unbanname[256];
unbanname = tmp;
if(udb_Exists(unbanname))
{
dUserSetINT(unbanname).("Banned", 0);
GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"UNBAN");
SaveToFile("UnBanNameLog",string);
SendRconCommand("reloadbans");
print(string);
return 1;
}
else return SendClientMessage(playerid, red, "ERROR: No player with this name.");
}
it done,i did it,thanks tu Turbo
can anyone help me for this
i did /nameunban and /offline ban
now,i need this
Код:
CMD:unbanip(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 5) return SendClientMessage(playerid,red, "You Cant Use This Command !!!");
if(IsPlayerAdmin(playerid))
{
new integ;if(sscanf(params,"u", integ)) return SendClientMessage(playerid, red, "Usage: /unban [IP: ADDRESS]");
if(integ >=32) return SendClientMessage(playerid, red, "IP ADDRESS IS TOO LONG");
new UnBanIp[80],IpAdd[128];format(UnBanIp,sizeof(UnBanIp),"unbanip %s",integ);
SendRconCommand(UnBanIp);
format(IpAdd,sizeof(IpAdd),"You Have Unbanned IP: %d",integ);
SendClientMessage(playerid,red,IpAdd);
}
return 1;
}
how to remove Rcon ,i dont want /rcon login password,i just wanna make lvl 2 + can ban player