30.05.2014, 09:46
how to send the ban message in a dialog box
of this i want
this too
of this i want
Код:
CMD:ban(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 4) { new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /lban [playerid] [reason]"); if(isnull(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second); CMDMessageToAdmins(playerid,"BAN"); format(string,sizeof(string),"%s has been banned by Administrator %s [Reason: %s] [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite); SendClientMessageToAll(grey,string); SaveToFile("BanLog",string); aresetpall(player1); print(string); if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1); format(string,sizeof(string),"Banned by Administrator %s. Reason: %s", adminname, params[2] ); return BanEx(player1, string); } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } 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"); }
Код:
CMD:rban(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 4) { new ip[128], tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /rban [playerid] [reason]"); if(isnull(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second); CMDMessageToAdmins(playerid,"RBAN"); format(string,sizeof(string),"%s has been range banned by Administrator %s [Reason: %s] [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite); SendClientMessageToAll(grey,string); SaveToFile("BanLog",string); print(string); aresetpall(player1); if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1); GetPlayerIp(player1,ip,sizeof(ip)); strdel(ip,strlen(ip)-2,strlen(ip)); format(ip,128,"%s**",ip); format(ip,128,"banip %s",ip); SendRconCommand(ip); Kick(player1); return 1; } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } 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"); }