Jump to content

[Tutorial] Securitate la admini/helperi


BizZar

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.