Jump to content
  • 0

Problema comanda /unban si /unbanip


ShowBell

Question

7 answers to this question

Recommended Posts

uite aici comenzile de care ai nevoie

    if(strcmp(cmd, "/unbanip", true) == 0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 1339)
		{
		    tmp = strtok(cmdtext,idx);
		    if(!strlen(tmp))
		    {
		        SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /unbanip [ players ip ]");
		        return 1;
   			}
			format(string,sizeof(string),"unbanip %s",tmp);
			SendRconCommand(string);
			SendRconCommand("reloadbans");
			PlayerInfo[giveplayerid][pLocked] = 0;
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, 256, "AdmWarning: %s has unbanned IP %s", sendername,tmp);
			ABroadCast(COLOR_YELLOW,string,1);
		}
		return 1;
	}
	if (strcmp(cmd, "/unban", true) == 0)
	{
	    if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1339)
	    {
	        tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
			{
		        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playerid/PartOfName]");
	            return 1;
		 	}
		 	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(giveplayer));
		 	format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
		 	ABroadCast(COLOR_YELLOW,string,1);
			format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
			printf(string);
			format(string,sizeof(string),"%s.ini",tmp);
			fremove(string);
			PlayerInfo[giveplayerid][pLocked] = 0;
			SendClientMessage(playerid, COLOR_WHITE, "Player unbanned");
			SendRconCommand(string);
			SendRconCommand("reloadbans");
   			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			GetPlayerName(playerid, sendername, sizeof(sendername));
		}
		return 1;
	}

sau dak nu merge nici asa incearca sa intri in contul pe care are ban si la level acolo vei gasi asa k e -999

u treci lv pe care l-a avut acel player inainte sa ia ban

sper k ti-am fost de folos

Link to comment
Share on other sites

Am o problema la comanda /unban si /unbanip in sensul ca dau /unban sau /unbanip si nu scoate ban-ul ... l-am tot modificat dar tot asa ... cine poate sa ma ajute? eventual sa imi dea o comanda de unban buna...

Daca playerul care iai dat ban are ip dynamic (schimbator) si el se deconecteaza de la net si se conecteaza iar i se va schimba ip si trebuie sa dai /unbanip cu ipul care il are pe moment :P

Link to comment
Share on other sites

In comanda asta:

  if (strcmp(cmd, "/unban", true) == 0)

  {

      if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1339)

      {

          tmp = strtok(cmdtext, idx);

          if(!strlen(tmp))

        {

              SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playerid/PartOfName]");

              return 1;

          }

          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

          GetPlayerName(playerid, sendername, sizeof(giveplayer));

          format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);

          ABroadCast(COLOR_YELLOW,string,1);

        format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);

        printf(string);

        format(string,sizeof(string),"%s.ini",tmp);

        fremove(string);

        PlayerInfo[giveplayerid][pLocked] = 0;

        SendClientMessage(playerid, COLOR_WHITE, "Player unbanned");

        SendRconCommand(string);

        SendRconCommand("reloadbans");

            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

        GetPlayerName(playerid, sendername, sizeof(sendername));

      }

      return 1;

  }

Cum fac sa nu stearga contu ?

Link to comment
Share on other sites

showbell

scoate asta:

fremove(string);

   if (strcmp(cmd, "/unban", true) == 0)
   {
       if((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1339)
       {
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
         {
              SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playerid/PartOfName]");
               return 1;
          }
          GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
          GetPlayerName(playerid, sendername, sizeof(giveplayer));
          format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
          ABroadCast(COLOR_YELLOW,string,1);
         format(string, 256, "AdmWarning: %s has unbanned %s", sendername, tmp);
         printf(string);
         format(string,sizeof(string),"%s.ini",tmp);
         PlayerInfo[giveplayerid][pLocked] = 0;
         SendClientMessage(playerid, COLOR_WHITE, "Player unbanned");
         SendRconCommand(string);
         SendRconCommand("reloadbans");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
         GetPlayerName(playerid, sendername, sizeof(sendername));
      }
      return 1;
   }

Link to comment
Share on other sites

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.