Jump to content

Recommended Posts

Posted (edited)

In acest tutorial veti invata cum sa va securizati comenzile de admin/helper.

La ce ajuta acest sistem?
Daca deti helper / admin pe server si eventual iti este sparta parola iti va mai cere o parola pentru folosirea comenzilor respective gradului.

1. La inceput in gamemode punem:

	new admacc[MAX_PLAYERS];
	#define DIALOG_SECURITY				630


2. Mergem la onplayerconnect si punem:

admacc[playerid] = 0;


3. Mergem la onplayerlogin si punem:

if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pHelper] > 0) return ShowPlayerDialog(playerid, DIALOG_SECURITY, DIALOG_STYLE_PASSWORD, "{FFFFFF}Security Step:", "{FFFFFF}Deoarece ai admin sau helper.\n\n{FFFFFF}Trebuie sa introduci parola de securitate mai jos:", "Ok", "Exit");


Atentie trebuie pus dupa ce s-a spawnat jucatorul.

4. Creem dialogul.

	if(dialogid == DIALOG_SECURITY)
	{
	switch(response)
	{
	case 0: return SendClientMessage(playerid, COLOR_ERROR, "Nu vei putea folosi nici o comanda!");
	case 1:
	{
	if(strfind("parolaadmin", inputtext, true) == 0)
	{
	SCM(playerid, -1, "Acum poti folosii orice comanda");
	admacc[playerid] = 1;
	}
	else return SCM(playerid, -1, "Nu poti folosi nici o comanda!");
	}
	}
	return 1;
	}

5. Adaugam la comenzile de admin/helper.

if(admacc[playerid] == 0) return SCM(playerid, -1, "Nu poti folosi aceasta comanda, contul tau este blocat!");

Daca v-a placut tutorialul +1 :).

Edited by BizZar
Posted
29 minutes ago, zEr0Spaima said:

mortii ma-tii imi furi tutorialul, mi-as pula-n ma-ta, pune credite

Eu in locul tau taceam, sistemul asta era la moda prin 2008, te faci de ras.

Retras

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.