Jump to content
  • 0

Problema comanda


Mister

Question

Problema intalnita (descriere): Am server pe ini si as dori sa fac o comanda unbanall
Ero(area / rile) / warning-(ul / urile): --
Liniile de cod / sursa / script-ul:

 

 

dcmd_unban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 6)
      {
        new PlayerFile[50];
        format(PlayerFile, sizeof(PlayerFile), "LARP/Users/%s.ini", params);
        if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [playername]");
        if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Nu exista nici un jucator cu numele specificat");
        if(dini_Int(PlayerFile,"Banned") == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Playerul nu are Ban");
        dini_IntSet(PlayerFile, "Banned", 0);
        SendClientMessage(playerid, COLOR_GREEN, "Jucatorul a fost debanat");
    }
      return 1;
}

 

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da am facut aceasta comanda de unban la cineva dar se poate face sa ia toti playerii toate conturile?

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Foloseste comanda asta:

if(strcmp(cmd, "/unban", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GRAD2, "Tasteaza: /unban [nume jucator(COMPLET)]");
			return 1;
		}
		if(PlayerInfo[playerid][pAdmin] < 1)
		{
			SCM(playerid, -1, "Nu esti autorizat sa folosesti aceasta comanda!");
			return 1;
		}
		format ( string, sizeof ( string ), "Utilizatori/%s.ini", tmp);
		freplaceline ( string, "Banned=1n", "Banned=0n" );
		GetPlayerName(playerid, sendername, sizeof(sendername));
		new string2[128];
		format(string2, sizeof(string2), "Utilizatorul %s a primit unban!", tmp);
		SCM(playerid, -1, string2);
		new string3[128];
		format(string3, sizeof(string3), "ADMIN INFO: {FFFFFF}%s a primit unban de la administrator %s", tmp, sendername);
		ABroadCast(COLOR_LIGHTRED, string3, 1);
		UnbanLog(string3);
	}

Insa , iti mai trebuie si un public:

 

forward UnbanLog(string[]);
public UnbanLog(string[])
{
new entry[256];
format(entry, sizeof(entry), "%sn",string);
new File:hFile;
hFile = fopen("Loguri/unbans.log", io_append); //Verifica daca playerul X are banned , iar daca are prin comanda [/unban] acesta va fi debanat!
fwrite(hFile, entry);
fclose(hFile);
}

La publicul OnPlayerLogin adaugi :

if(PlayerInfo[playerid][pBanned] == 1)
		{
	    	new string1[128];
	    	format(string1, sizeof(string1), "This account was banned by an Administrator!For the request unban please visit the website!");
			SCM(playerid, COLOR_LIGHTRED, string1);
			Kick(playerid);
			return 1;
		} //Prelueaza informatiile din ban.cfg si le trimite catre login.In cazul un care ai banned va aparea mesajul de mai sus!

Sper ca te-am ajutat, astept un raspuns!

Link to comment
Share on other sites

  • 0

Nu cred ca ai inteles comanda pe care ai scris o tu este la fel ca a mea,

Comanda aia da unban la un player nu?

Eu vreau o comanda care sa dea unban la toti playerii la toate conturile

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.