Jump to content
  • 0

Tban


Ph0eniX

Question

salutare imi poate modifica si mei va rog eu mult comanda asta...e ban normal (adica permanent) sa fie ban pe timp adica zile de la 1 la 99

CMD:ban(playerid,params[])
{
	if(AccInfo[playerid][LoggedIn] == 1)
	{
		if(AccInfo[playerid][Level] >= 5)
		{
			new tmp2[30], string[128], year, month, day, hour, minuite, second, userid, player1, fuuid;
			//------------------------------------------------------------------
		    if(sscanf(params, "us[30]", player1, tmp2)) return
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
			SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
			//------------------------------------------------------------------
		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
			{
			    //--------------------------------------------------------------
    			if((gettime() - ABanAll[playerid]) < 40)
    			{
    			    AccInfo[playerid][BanLimit]++;
    			}
    			else
    			{
    			    AccInfo[playerid][BanLimit] = 0;
    			    ABanAll[playerid] = gettime();
    			}
    			//--------------------------------------------------------------
    			if(AccInfo[playerid][BanLimit] == 4)
    			{
					fuuid = BUD::GetNameUID(PlayerName2(playerid));
					BUD::SetIntEntry(fuuid, "Banned", 1);
    				SendClientMessage(playerid, red, "You have been automatically Banned by our Server (Reason: Ban All Try)!");
					BanEx(playerid, "Banned by - Anti-Ban All System");
				}
			    //--------------------------------------------------------------
			    else
			    {
					getdate(year, month, day); gettime(hour,minuite,second);
					//----------------------------------------------------------
					SendCommandToAdmins(playerid,"Ban");
                	//----------------------------------------------------------
               	 	ASts[playerid][Bans] += 1;
                	//----------------------------------------------------------
					SendClientMessageToAll(red, "==============(Ban Details)==============");
					if(AccInfo[playerid][Hide] == 1)
					{
						format(string, 128, "%s has been Banned", PlayerName2(player1));
					}
					else if(AccInfo[playerid][Hide] == 0)
					{
					    format(string, 128, "%s has been Banned by %s", PlayerName2(player1), PlayerName2(playerid));
					}
					SendClientMessageToAll(orange, string);
					format(string, 128, "Reason: %s", tmp2);
					SendClientMessageToAll(0x00BBF6AA,string);
					format(string, 128,"Date: %d/%d/%d | Time: %d:%d", day, month, year, hour, minuite);
					SendClientMessageToAll(orange, string);
                	SendClientMessageToAll(red, "======================================");
					//----------------------------------------------------------
					SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
					SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
					SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
					SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
            	    SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
	                SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
	                SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
	                SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
	                SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
	                SendClientMessage(player1, -1, ""); SendClientMessage(player1, -1, "");
					//----------------------------------------------------------
					SendClientMessage(player1, red, "==============(Ban Details)==============");
    				format(string, 128, "You have been {FF0000}Banned{AFAFAF} by {FF0000}%s", PlayerName2(playerid));
					SendClientMessage(player1, grey, string);
					format(string, 128, "Reason: {FF0000}%s", tmp2);
					SendClientMessage(player1, grey, string);
					format(string, 128, "Press {FF0000}F8{AFAFAF} to make an Screenshot! Visit {FF0000}www.RGS-Community.tk{AFAFAF} for UnBan!", day, month, year, hour, minuite);
					SendClientMessage(player1, grey, string);
                	SendClientMessage(player1, red, "======================================");
					//----------------------------------------------------------
					format(string, 128,"%s has been Banned by Administrator %s | Reason: %s", PlayerName2(player1), PlayerName2(playerid),tmp2);
					SaveIn("BanLog", string);
					//----------------------------------------------------------
					userid = BUD::GetNameUID(PlayerName2(player1));
					BUD::SetIntEntry(userid, "Banned", 1);
					return Ban(player1);
				}
				return 1;
			}
            else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is yourself or is the highest level admin");
		}
		else return SendClientMessage(playerid, red, "ERROR: You must be Level 7 to use this command!");
	}
	else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}

Multumesc:D

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.