Jump to content

[TUTORIAL] Sistem Pin


Daedric-Fox

Recommended Posts

Introducere:

Salutare tuturor, astazi o sa va arat cum se creeaza un sistem de pin.Acesta este ultimul meu tutorial si totodata si ultimul script creat de mine(DaEdRiC-FoX), dupa aceea ma voi retrage din lumea SA:MP-ului.

Pasul I: Structura

-Prima data va trebuie sa punem variabila pinului:

pPin//Aceasta este o variabila la fel ca celelalte : pAdmin,pHelper etc.

Apasam tasta CTRL+F si cautam pAdmin sau orice altceva care face parte din PlayerData/PlayerInfo sau cum aveti voi.

Unii folosesc direct metoda de update in baza de date:

mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Cash`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pCash], playerName);
mysql_query(handle, string);

dar eu prefer sa fac astefel:

//Pun sub enum-ul de la PlayerInfo:
enum
{
	pPinu//ATENTIE!!Nu este pPin ci este pPinu, trebuie sa difere de variabila de la PlayerInfo.Mai puteti pune si pPinx, cum doriti.
};
//Apoi punem la inceputul gm-ului:
forward Update(playerid, type);
//Mergem oriunde in gm si punem:
public Update(playerid, type)//de Update(); ne vom folosi mai tarziu, v-eti intelege.
{
	if(IsPlayerConnected(playerid))
	{
		new string[256];//aici creem un string, sau putem pune query in loc de string.
		new playerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playerName, sizeof(playerName));//Aici cautam numele playerului in cauza.
		{
			switch(type)
			{
				case pPinu:
				{
					mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Pin`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pPin],playerName);//Aici se va face introducerea in baza de date.
					mysql_query(handle, string);
				}
			}
		}
	}
}

Acum cand vom avea nevoie sa facem update la pin(sa facem introducerea in baza de date pentru cei care nu inteleg)vom pune:

Update(playerid, pPinu);//Se actioneaza collback-ul si se face update in baza de date, fara sa mai scriem altceva in plus

-Bun, apoi va trebui sa facem extragerea Pinului din baza de date:-Mergem la public OnLogin/OnPlayerLogin/WhenPlayerLogin depinde cum aveti voi si punem:

PlayerData[playerid][pPin] = cache_get_field_content_int(0, "Pin");//Aici vom extrage din baza de date pin-ul playerului in cauza.

-Bun acum structura este gata.

Pasul II: Textdraw-urile

-Eu am deja facute textdraw-urile, dar daca voi vreti altele puteti face cu ipleomax.

//Astea trebuie puse la inceputul Gm-ului, definim textdraw-urile.
new Text:PinBox[3][MAX_PLAYERS];
new Text:PinClose[2][MAX_PLAYERS];
new Text:PinVerde[MAX_PLAYERS];
new Text:PinRosu[MAX_PLAYERS];
new Text:PinCifra[10][MAX_PLAYERS];
new Text:PinText[MAX_PLAYERS];
new numberab[MAX_PLAYERS][5];//asta va fi pentru cifre
//Apoi, mergem la publicul OnPlayerConnect si punem textdraw-urile:
	PinBox[0][playerid] = TextDrawCreate(393.999969, 132.913330, "usebox");
	TextDrawLetterSize(PinBox[0][playerid], 0.000000, 26.618642);
	TextDrawTextSize(PinBox[0][playerid], 235.777816, 0.000000);
	TextDrawAlignment(PinBox[0][playerid], 1);
	TextDrawColor(PinBox[0][playerid], 0);
	TextDrawUseBox(PinBox[0][playerid], true);
	TextDrawBoxColor(PinBox[0][playerid], 102);
	TextDrawSetShadow(PinBox[0][playerid], 0);
	TextDrawSetOutline(PinBox[0][playerid], 0);
	TextDrawFont(PinBox[0][playerid], 0);

	PinBox[1][playerid] = TextDrawCreate(386.444427, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[1][playerid], 0.000000, 24.904077);
	TextDrawTextSize(PinBox[1][playerid], 242.000000, 0.000000);
	TextDrawAlignment(PinBox[1][playerid], 1);
	TextDrawColor(PinBox[1][playerid], 0);
	TextDrawUseBox(PinBox[1][playerid], true);
	TextDrawBoxColor(PinBox[1][playerid], 102);
	TextDrawSetShadow(PinBox[1][playerid], 0);
	TextDrawSetOutline(PinBox[1][playerid], 0);
	TextDrawFont(PinBox[1][playerid], 0);

	PinBox[2][playerid] = TextDrawCreate(386.000000, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[2][playerid], 0.000000, 5.767285);
	TextDrawTextSize(PinBox[2][playerid], 242.444442, 0.000000);
	TextDrawAlignment(PinBox[2][playerid], 1);
	TextDrawColor(PinBox[2][playerid], 0);
	TextDrawUseBox(PinBox[2][playerid], true);
	TextDrawBoxColor(PinBox[2][playerid], -2139094785);
	TextDrawSetShadow(PinBox[2][playerid], 0);
	TextDrawSetOutline(PinBox[2][playerid], 0);
	TextDrawFont(PinBox[2][playerid], 0);

	PinClose[0][playerid] = TextDrawCreate(376.888885, 130.915557, "LD_POOL:BALL");
	TextDrawLetterSize(PinClose[0][playerid], 0.000000, 0.000000);
	TextDrawTextSize(PinClose[0][playerid], 15.111114, 16.924453);
	TextDrawAlignment(PinClose[0][playerid], 1);
	TextDrawColor(PinClose[0][playerid], -1);
	TextDrawSetShadow(PinClose[0][playerid], 0);
	TextDrawSetOutline(PinClose[0][playerid], 0);
	TextDrawFont(PinClose[0][playerid], 4);

	PinClose[1][playerid] = TextDrawCreate(385.333374, 131.911132, "X");
	TextDrawLetterSize(PinClose[1][playerid], 0.454444, 1.624888);
	TextDrawTextSize(PinClose[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinClose[1][playerid], 2);
	TextDrawColor(PinClose[1][playerid], -2147483393);
	TextDrawSetShadow(PinClose[1][playerid], 0);
	TextDrawSetOutline(PinClose[1][playerid], 1);
	TextDrawBackgroundColor(PinClose[1][playerid], 51);
	TextDrawFont(PinClose[1][playerid], 2);
	TextDrawSetProportional(PinClose[1][playerid], 1);
	TextDrawSetSelectable(PinClose[1][playerid], true);

	PinVerde[playerid] = TextDrawCreate(272.888916, 341.475646, "OK");
	TextDrawLetterSize(PinVerde[playerid], 0.501111, 1.500444);
	TextDrawTextSize(PinVerde[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinVerde[playerid], 2);
	TextDrawColor(PinVerde[playerid], 16711935);
	TextDrawSetShadow(PinVerde[playerid], 0);
	TextDrawSetOutline(PinVerde[playerid], 1);
	TextDrawBackgroundColor(PinVerde[playerid], 51);
	TextDrawFont(PinVerde[playerid], 3);
	TextDrawSetProportional(PinVerde[playerid], 1);
	TextDrawSetSelectable(PinVerde[playerid], true);

	PinRosu[playerid] = TextDrawCreate(355.555572, 341.475646, "DEL");
	TextDrawLetterSize(PinRosu[playerid], 0.345555, 1.600000);
	TextDrawTextSize(PinRosu[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinRosu[playerid], 2);
	TextDrawColor(PinRosu[playerid], -16776961);
	TextDrawSetShadow(PinRosu[playerid], 0);
	TextDrawSetOutline(PinRosu[playerid], 1);
	TextDrawBackgroundColor(PinRosu[playerid], 51);
	TextDrawFont(PinRosu[playerid], 3);
	TextDrawSetProportional(PinRosu[playerid], 1);
	TextDrawSetSelectable(PinRosu[playerid], true);

	PinCifra[0][playerid] = TextDrawCreate(315.999908, 341.475646, "0");
	TextDrawLetterSize(PinCifra[0][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[0][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[0][playerid], 2);
	TextDrawColor(PinCifra[0][playerid], -1);
	TextDrawSetShadow(PinCifra[0][playerid], 0);
	TextDrawSetOutline(PinCifra[0][playerid], 1);
	TextDrawBackgroundColor(PinCifra[0][playerid], 51);
	TextDrawFont(PinCifra[0][playerid], 3);
	TextDrawSetProportional(PinCifra[0][playerid], 1);
	TextDrawSetSelectable(PinCifra[0][playerid], true);

	PinCifra[1][playerid] = TextDrawCreate(264.444335, 207.573303, "1");
	TextDrawLetterSize(PinCifra[1][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[1][playerid], 2);
	TextDrawColor(PinCifra[1][playerid], -1);
	TextDrawSetShadow(PinCifra[1][playerid], 0);
	TextDrawSetOutline(PinCifra[1][playerid], 1);
	TextDrawBackgroundColor(PinCifra[1][playerid], 51);
	TextDrawFont(PinCifra[1][playerid], 3);
	TextDrawSetProportional(PinCifra[1][playerid], 1);
	TextDrawSetSelectable(PinCifra[1][playerid], true);

	PinCifra[2][playerid] = TextDrawCreate(316.444396, 207.573318, "2");
	TextDrawLetterSize(PinCifra[2][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[2][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[2][playerid], 2);
	TextDrawColor(PinCifra[2][playerid], -1);
	TextDrawSetShadow(PinCifra[2][playerid], 0);
	TextDrawSetOutline(PinCifra[2][playerid], 1);
	TextDrawBackgroundColor(PinCifra[2][playerid], 51);
	TextDrawFont(PinCifra[2][playerid], 3);
	TextDrawSetProportional(PinCifra[2][playerid], 1);
	TextDrawSetSelectable(PinCifra[2][playerid], true);

	PinCifra[3][playerid] = TextDrawCreate(359.999908, 209.066650, "3");
	TextDrawLetterSize(PinCifra[3][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[3][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[3][playerid], 2);
	TextDrawColor(PinCifra[3][playerid], -1);
	TextDrawSetShadow(PinCifra[3][playerid], 0);
	TextDrawSetOutline(PinCifra[3][playerid], 1);
	TextDrawBackgroundColor(PinCifra[3][playerid], 51);
	TextDrawFont(PinCifra[3][playerid], 3);
	TextDrawSetProportional(PinCifra[3][playerid], 1);
	TextDrawSetSelectable(PinCifra[3][playerid], true);

	PinCifra[4][playerid] = TextDrawCreate(264.888824, 249.386657, "4");
	TextDrawLetterSize(PinCifra[4][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[4][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[4][playerid], 2);
	TextDrawColor(PinCifra[4][playerid], -1);
	TextDrawSetShadow(PinCifra[4][playerid], 0);
	TextDrawSetOutline(PinCifra[4][playerid], 1);
	TextDrawBackgroundColor(PinCifra[4][playerid], 51);
	TextDrawFont(PinCifra[4][playerid], 3);
	TextDrawSetProportional(PinCifra[4][playerid], 1);
	TextDrawSetSelectable(PinCifra[4][playerid], true);

	PinCifra[5][playerid] = TextDrawCreate(315.111053, 249.386627, "5");
	TextDrawLetterSize(PinCifra[5][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[5][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[5][playerid], 2);
	TextDrawColor(PinCifra[5][playerid], -1);
	TextDrawSetShadow(PinCifra[5][playerid], 0);
	TextDrawSetOutline(PinCifra[5][playerid], 1);
	TextDrawBackgroundColor(PinCifra[5][playerid], 51);
	TextDrawFont(PinCifra[5][playerid], 3);
	TextDrawSetProportional(PinCifra[5][playerid], 1);
	TextDrawSetSelectable(PinCifra[5][playerid], true);

	PinCifra[6][playerid] = TextDrawCreate(360.888793, 249.884399, "6");
	TextDrawLetterSize(PinCifra[6][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[6][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[6][playerid], 2);
	TextDrawColor(PinCifra[6][playerid], -1);
	TextDrawSetShadow(PinCifra[6][playerid], 0);
	TextDrawSetOutline(PinCifra[6][playerid], 1);
	TextDrawBackgroundColor(PinCifra[6][playerid], 51);
	TextDrawFont(PinCifra[6][playerid], 3);
	TextDrawSetProportional(PinCifra[6][playerid], 1);
	TextDrawSetSelectable(PinCifra[6][playerid], true);

	PinCifra[7][playerid] = TextDrawCreate(264.888824, 291.697784, "7");
	TextDrawLetterSize(PinCifra[7][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[7][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[7][playerid], 2);
	TextDrawColor(PinCifra[7][playerid], -1);
	TextDrawSetShadow(PinCifra[7][playerid], 0);
	TextDrawSetOutline(PinCifra[7][playerid], 1);
	TextDrawBackgroundColor(PinCifra[7][playerid], 51);
	TextDrawFont(PinCifra[7][playerid], 3);
	TextDrawSetProportional(PinCifra[7][playerid], 1);
	TextDrawSetSelectable(PinCifra[7][playerid], true);

	PinCifra[8][playerid] = TextDrawCreate(313.777709, 291.697723, "8");
	TextDrawLetterSize(PinCifra[8][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[8][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[8][playerid], 2);
	TextDrawColor(PinCifra[8][playerid], -1);
	TextDrawSetShadow(PinCifra[8][playerid], 0);
	TextDrawSetOutline(PinCifra[8][playerid], 1);
	TextDrawBackgroundColor(PinCifra[8][playerid], 51);
	TextDrawFont(PinCifra[8][playerid], 3);
	TextDrawSetProportional(PinCifra[8][playerid], 1);
	TextDrawSetSelectable(PinCifra[8][playerid], true);

	PinCifra[9][playerid] = TextDrawCreate(361.333251, 291.199951, "9");
	TextDrawLetterSize(PinCifra[9][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[9][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[9][playerid], 2);
	TextDrawColor(PinCifra[9][playerid], -1);
	TextDrawSetShadow(PinCifra[9][playerid], 0);
	TextDrawSetOutline(PinCifra[9][playerid], 1);
	TextDrawBackgroundColor(PinCifra[9][playerid], 51);
	TextDrawFont(PinCifra[9][playerid], 3);
	TextDrawSetProportional(PinCifra[9][playerid], 1);
	TextDrawSetSelectable(PinCifra[9][playerid], true);

	PinText[playerid] = TextDrawCreate(310.222320, 159.288879, "_");
	TextDrawLetterSize(PinText[playerid], 0.449999, 1.600000);
	TextDrawAlignment(PinText[playerid], 2);
	TextDrawColor(PinText[playerid], -1378294017);
	TextDrawSetShadow(PinText[playerid], 0);
	TextDrawSetOutline(PinText[playerid], 0);
	TextDrawBackgroundColor(PinText[playerid], 51);
	TextDrawFont(PinText[playerid], 1);
	TextDrawSetProportional(PinText[playerid], 1);

-Am create structura, am introdus textdra-urile acum ce face?

-Le facem functionale:

//Cautam publicul OnPlayerClickTextDraw, este posibil sa nu il aveti dar il copiati:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == PinClose[1][playerid])
    {
   		TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
		TextDrawHideForPlayer(playerid,PinVerde[playerid]);
		TextDrawHideForPlayer(playerid,PinRosu[playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
		TextDrawHideForPlayer(playerid,PinText[playerid]);
    	CancelSelectTextDraw(playerid);
    	TogglePlayerControllable(playerid, 1);
    	new string[12];
    	format(string, 32,"____");
		TextDrawSetString(PinText[playerid], string);
    }
    if(clickedid == PinCifra[0][playerid])
    {
        strcat(numberab[playerid],"0");//aici se adauga pe rand cate o cifra la fel si la restul.
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[1][playerid])
    {
        strcat(numberab[playerid],"1");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[2][playerid])
    {
        strcat(numberab[playerid],"2");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[3][playerid])
    {
        strcat(numberab[playerid],"3");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[4][playerid])
    {
        strcat(numberab[playerid],"4");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[5][playerid])
    {
        strcat(numberab[playerid],"5");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[6][playerid])
    {
        strcat(numberab[playerid],"6");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[7][playerid])
    {
        strcat(numberab[playerid],"7");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[8][playerid])
    {
        strcat(numberab[playerid],"8");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[9][playerid])
    {
        strcat(numberab[playerid],"9");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinVerde[playerid])
    {
        if(PlayerData[playerid][pPin] == 0)//aici verificam daca playerul nu are niciun pin in baza de date
        {
			new string[200];
			new addpin = strval(numberab[playerid]);
			PlayerData[playerid][pPin] = addpin;
			format(string, sizeof(string), Bot"Contul tau este acum securizat.Codul pin este: %d.Nu uita sa fac printscreen in caz ca il vei uita(F8).", addpin);
			SCM(playerid, -1, string);
			Update(playerid,pPinu);
			AccountLock[playerid] = 1;
			TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
			TextDrawHideForPlayer(playerid,PinVerde[playerid]);
			TextDrawHideForPlayer(playerid,PinRosu[playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
			TextDrawHideForPlayer(playerid,PinText[playerid]);
	    	TogglePlayerControllable(playerid, 1);
			CancelSelectTextDraw(playerid);
			format(string, 32,"_");
			TextDrawSetString(PinText[playerid], string);

		}
		else
		{
			if(PlayerData[playerid][pPin] == strval(numberab[playerid]))//aici verificam daca, codul din baza de date este identic cu cel introdus
			{
				new string[32];
				SCM(playerid, -1, Bot"Contul tau a fost deblocat cu succes!");
				TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
				TextDrawHideForPlayer(playerid,PinVerde[playerid]);
				TextDrawHideForPlayer(playerid,PinRosu[playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
				TextDrawHideForPlayer(playerid,PinText[playerid]);
		    	TogglePlayerControllable(playerid, 1);
				CancelSelectTextDraw(playerid);
				format(string, 32,"_");
				TextDrawSetString(PinText[playerid], string);
			}
			else{SCM(playerid,-1,"{f24848}Cod pin gresit!");}
		}
    }
    if(clickedid == PinRosu[playerid])
    {
        strdel(numberab[playerid], 0,strval(numberab[playerid]));//aici stergem codul introdus
    }
    return 1;
}

-Bun deci structura a fost facuta, textdraw-urile puse, butoanele functionale, urmatorul pas comenzile.

Pasul III: Comenzile

CMD:setpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] == 0)//verificam daca playerul nu are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF33);
        TogglePlayerControllable(playerid, 0);
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau este deja securizat cu un cod pin tasteaza [/loginpin] pentru a debloca contul!");
    }
    return 1;
}
CMD:loginpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] > 0)//Verificam daca playerul are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF66);
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau nu este securizat cu un cod pin!Tasteaza [/setpin] pentru a seta unul!");
    }
    return 1;
}
CMD:pin(playerid, params[])
{
    return cmd::loginpin(playerid, params);//creem o scurtatura pentru comanda /Loginpin
}

!!!Atentie!!!Eu am folosit procesorul de comenzi LIFE-CMD, comenzile sunt la fel dar scurtatura acea difera, deci daca folositi zcmd veti pune:

CMD:pin(playerid, params[])
{
	return cmd_loginpin(playerid, params);
}

Pasul IV: Tabelul in baza de date

56ed23ee665dc_pas1.thumb.png.73befa7b4f4

1.Mergem la tabelul users sau players sau accounts cum aveti voi apoi:

56ed25aada8c5_pas2.thumb.png.b0a8587c5a2

2.Adaugam un nou rand dupa ultimul

56ed25e6384fa_pas3.thumb.png.526e5a0021c

3.Noul rand va fi de timp int(intreg)cu lungimea de 4, si va avea valoarea 0 pana ce aceasta se va schimba.

 

 

Bun, acesta a fost tutorialul, sper ca ati inteles.

Sper ca veti pastra creditele.

!!!Atentie!!! +1 daca ti-a fost de folos.

 

 

  • Upvote 5

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Frumos tutorial, 10/10 pacat ca reproduceti serverele mari daca nu aveau ei sistem pin probabil vi se parea o prostie idea de pin

 

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

2 hours ago, Mister said:

Frumos tutorial, 10/10 pacat ca reproduceti serverele mari daca nu aveau ei sistem pin probabil vi se parea o prostie idea de pin

Mersi, da asa este..

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

6 minutes ago, WiDuAlK said:

Tutorialul in sine e bunicel, cu mici exceptii de estetica si optimizare, iti lipseste niste return-uri pe acolo.

Pe de alta parte, ce as fi vrut sa vad este explicarea functiilor si algoritmului de gandire, pt ca asta e esential intr-un tutorial , nu codul.

Hmm..nu prea am avut timp sa fac un tutorial foarte avansat, dar cand voi avea timp voi explica absolut tot.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

(611) : warning 209: function "zcmd_OnGameModeInit" should return a value
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

611 este fix unde se termina OnGameModeInit. Oricum ai scapat multe, asta este singura caruia nu ii dau de cap.

Cum fac sa ii fac o restrictie la o comanda ?
 

Link to comment
Share on other sites

7 hours ago, PunkyRO said:

(611) : warning 209: function "zcmd_OnGameModeInit" should return a value
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.

611 este fix unde se termina OnGameModeInit. Oricum ai scapat multe, asta este singura caruia nu ii dau de cap.

Cum fac sa ii fac o restrictie la o comanda ?
 

hmm,arata ce este pus deasupra liniei 611, si depinde ce restrictive vrei:

if(conditie)
{
	executa 1..
}
else
{
	executa 2
}
//EX:
if(PlayerData[playerid][pAdmin] > 0)//verificam daca playerul are adminul mai mare ca 0
{
	//executam ceva
}
else//altfel, daca nu are adminul mai mare ca 0 ii dam un mesaj
{
	SendClientMessage(playerid, -1, "Nu ai gradul de admin ma mare ca 0");
}

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Acum 3 ore, DaEdRiC-FoX a spus:

hmm,arata ce este pus deasupra liniei 611, si depinde ce restrictive vrei:


if(conditie)
{
	executa 1..
}
else
{
	executa 2
}
//EX:
if(PlayerData[playerid][pAdmin] > 0)//verificam daca playerul are adminul mai mare ca 0
{
	//executam ceva
}
else//altfel, daca nu are adminul mai mare ca 0 ii dam un mesaj
{
	SendClientMessage(playerid, -1, "Nu ai gradul de admin ma mare ca 0");
}

 

Citat


652    ShowPlayerMarkers(0);
654    EnableStuntBonusForAll(0);
655    UsePlayerPedAnims();

656    return 1;
657 }

Am mai adaugat ceva si nu mai este linia 611 este 657  cu aceeasi eroare.

Link to comment
Share on other sites

Nu stiu cum sa iti zic Daedric ,dar trebuie sa fi putin cam prostut sa pui un astfel de script , mai ales tutorial pe net . Adica iti apreciez munca si iti voi oferi un +1 pt. aceasta , dar un astfel de script se vinde si cu 10 euro si mai ales daca il ai intr-un gamemode ii creste valoare si sansele de a fi vandut . Oricum frumos tutorial .

Link to comment
Share on other sites

2 hours ago, CarS said:

Nu stiu cum sa iti zic Daedric ,dar trebuie sa fi putin cam prostut sa pui un astfel de script , mai ales tutorial pe net . Adica iti apreciez munca si iti voi oferi un +1 pt. aceasta , dar un astfel de script se vinde si cu 10 euro si mai ales daca il ai intr-un gamemode ii creste valoare si sansele de a fi vandut . Oricum frumos tutorial .

Nu sunt adeptul banilor, si atat timp cat eu pot si stiu, de ce sa nu-I ajut si pe alti?

 

2 hours ago, PunkyRO said:

Am mai adaugat ceva si nu mai este linia 611 este 657  cu aceeasi eroare.

nu stiu ce ai omis tu, nu-mi dau seama, dar verifica sa nu  fie lipsa vreo returnale la publicul de deasupra de la OnGamemodeInit sau la ce de sub.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Acum 2 minute, DaEdRiC-FoX a spus:

nu stiu ce ai omis tu, nu-mi dau seama, dar verifica sa nu  fie lipsa vreo returnale la publicul de deasupra de la OnGamemodeInit sau la ce de sub.

Am rezolvat. Nu incadrasem ceva bine. Multumesc de sistem !

Link to comment
Share on other sites

Just now, PunkyRO said:

Am rezolvat. Nu incadrasem ceva bine. Multumesc de sistem !

Cu placere.

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 2 weeks later...
La 18.03.2016 la 12:14, DaEdRiC-FoX a spus:

Introducere:

Salutare tuturor, astazi o sa va arat cum se creeaza un sistem de pin.Acesta este ultimul meu tutorial si totodata si ultimul script creat de mine(DaEdRiC-FoX), dupa aceea ma voi retrage din lumea SA:MP-ului.

Pasul I: Structura

-Prima data va trebuie sa punem variabila pinului:


pPin//Aceasta este o variabila la fel ca celelalte : pAdmin,pHelper etc.

Apasam tasta CTRL+F si cautam pAdmin sau orice altceva care face parte din PlayerData/PlayerInfo sau cum aveti voi.

Unii folosesc direct metoda de update in baza de date:


mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Cash`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pCash], playerName);
mysql_query(handle, string);

dar eu prefer sa fac astefel:


//Pun sub enum-ul de la PlayerInfo:
enum
{
	pPinu//ATENTIE!!Nu este pPin ci este pPinu, trebuie sa difere de variabila de la PlayerInfo.Mai puteti pune si pPinx, cum doriti.
};
//Apoi punem la inceputul gm-ului:
forward Update(playerid, type);
//Mergem oriunde in gm si punem:
public Update(playerid, type)//de Update(); ne vom folosi mai tarziu, v-eti intelege.
{
	if(IsPlayerConnected(playerid))
	{
		new string[256];//aici creem un string, sau putem pune query in loc de string.
		new playerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playerName, sizeof(playerName));//Aici cautam numele playerului in cauza.
		{
			switch(type)
			{
				case pPinu:
				{
					mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Pin`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pPin],playerName);//Aici se va face introducerea in baza de date.
					mysql_query(handle, string);
				}
			}
		}
	}
}

Acum cand vom avea nevoie sa facem update la pin(sa facem introducerea in baza de date pentru cei care nu inteleg)vom pune:


Update(playerid, pPinu);//Se actioneaza collback-ul si se face update in baza de date, fara sa mai scriem altceva in plus

-Bun, apoi va trebui sa facem extragerea Pinului din baza de date:-Mergem la public OnLogin/OnPlayerLogin/WhenPlayerLogin depinde cum aveti voi si punem:


PlayerData[playerid][pPin] = cache_get_field_content_int(0, "Pin");//Aici vom extrage din baza de date pin-ul playerului in cauza.

-Bun acum structura este gata.

Pasul II: Textdraw-urile

-Eu am deja facute textdraw-urile, dar daca voi vreti altele puteti face cu ipleomax.


//Astea trebuie puse la inceputul Gm-ului, definim textdraw-urile.
new Text:PinBox[3][MAX_PLAYERS];
new Text:PinClose[2][MAX_PLAYERS];
new Text:PinVerde[MAX_PLAYERS];
new Text:PinRosu[MAX_PLAYERS];
new Text:PinCifra[10][MAX_PLAYERS];
new Text:PinText[MAX_PLAYERS];
new numberab[MAX_PLAYERS][5];//asta va fi pentru cifre
//Apoi, mergem la publicul OnPlayerConnect si punem textdraw-urile:
	PinBox[0][playerid] = TextDrawCreate(393.999969, 132.913330, "usebox");
	TextDrawLetterSize(PinBox[0][playerid], 0.000000, 26.618642);
	TextDrawTextSize(PinBox[0][playerid], 235.777816, 0.000000);
	TextDrawAlignment(PinBox[0][playerid], 1);
	TextDrawColor(PinBox[0][playerid], 0);
	TextDrawUseBox(PinBox[0][playerid], true);
	TextDrawBoxColor(PinBox[0][playerid], 102);
	TextDrawSetShadow(PinBox[0][playerid], 0);
	TextDrawSetOutline(PinBox[0][playerid], 0);
	TextDrawFont(PinBox[0][playerid], 0);

	PinBox[1][playerid] = TextDrawCreate(386.444427, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[1][playerid], 0.000000, 24.904077);
	TextDrawTextSize(PinBox[1][playerid], 242.000000, 0.000000);
	TextDrawAlignment(PinBox[1][playerid], 1);
	TextDrawColor(PinBox[1][playerid], 0);
	TextDrawUseBox(PinBox[1][playerid], true);
	TextDrawBoxColor(PinBox[1][playerid], 102);
	TextDrawSetShadow(PinBox[1][playerid], 0);
	TextDrawSetOutline(PinBox[1][playerid], 0);
	TextDrawFont(PinBox[1][playerid], 0);

	PinBox[2][playerid] = TextDrawCreate(386.000000, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[2][playerid], 0.000000, 5.767285);
	TextDrawTextSize(PinBox[2][playerid], 242.444442, 0.000000);
	TextDrawAlignment(PinBox[2][playerid], 1);
	TextDrawColor(PinBox[2][playerid], 0);
	TextDrawUseBox(PinBox[2][playerid], true);
	TextDrawBoxColor(PinBox[2][playerid], -2139094785);
	TextDrawSetShadow(PinBox[2][playerid], 0);
	TextDrawSetOutline(PinBox[2][playerid], 0);
	TextDrawFont(PinBox[2][playerid], 0);

	PinClose[0][playerid] = TextDrawCreate(376.888885, 130.915557, "LD_POOL:BALL");
	TextDrawLetterSize(PinClose[0][playerid], 0.000000, 0.000000);
	TextDrawTextSize(PinClose[0][playerid], 15.111114, 16.924453);
	TextDrawAlignment(PinClose[0][playerid], 1);
	TextDrawColor(PinClose[0][playerid], -1);
	TextDrawSetShadow(PinClose[0][playerid], 0);
	TextDrawSetOutline(PinClose[0][playerid], 0);
	TextDrawFont(PinClose[0][playerid], 4);

	PinClose[1][playerid] = TextDrawCreate(385.333374, 131.911132, "X");
	TextDrawLetterSize(PinClose[1][playerid], 0.454444, 1.624888);
	TextDrawTextSize(PinClose[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinClose[1][playerid], 2);
	TextDrawColor(PinClose[1][playerid], -2147483393);
	TextDrawSetShadow(PinClose[1][playerid], 0);
	TextDrawSetOutline(PinClose[1][playerid], 1);
	TextDrawBackgroundColor(PinClose[1][playerid], 51);
	TextDrawFont(PinClose[1][playerid], 2);
	TextDrawSetProportional(PinClose[1][playerid], 1);
	TextDrawSetSelectable(PinClose[1][playerid], true);

	PinVerde[playerid] = TextDrawCreate(272.888916, 341.475646, "OK");
	TextDrawLetterSize(PinVerde[playerid], 0.501111, 1.500444);
	TextDrawTextSize(PinVerde[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinVerde[playerid], 2);
	TextDrawColor(PinVerde[playerid], 16711935);
	TextDrawSetShadow(PinVerde[playerid], 0);
	TextDrawSetOutline(PinVerde[playerid], 1);
	TextDrawBackgroundColor(PinVerde[playerid], 51);
	TextDrawFont(PinVerde[playerid], 3);
	TextDrawSetProportional(PinVerde[playerid], 1);
	TextDrawSetSelectable(PinVerde[playerid], true);

	PinRosu[playerid] = TextDrawCreate(355.555572, 341.475646, "DEL");
	TextDrawLetterSize(PinRosu[playerid], 0.345555, 1.600000);
	TextDrawTextSize(PinRosu[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinRosu[playerid], 2);
	TextDrawColor(PinRosu[playerid], -16776961);
	TextDrawSetShadow(PinRosu[playerid], 0);
	TextDrawSetOutline(PinRosu[playerid], 1);
	TextDrawBackgroundColor(PinRosu[playerid], 51);
	TextDrawFont(PinRosu[playerid], 3);
	TextDrawSetProportional(PinRosu[playerid], 1);
	TextDrawSetSelectable(PinRosu[playerid], true);

	PinCifra[0][playerid] = TextDrawCreate(315.999908, 341.475646, "0");
	TextDrawLetterSize(PinCifra[0][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[0][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[0][playerid], 2);
	TextDrawColor(PinCifra[0][playerid], -1);
	TextDrawSetShadow(PinCifra[0][playerid], 0);
	TextDrawSetOutline(PinCifra[0][playerid], 1);
	TextDrawBackgroundColor(PinCifra[0][playerid], 51);
	TextDrawFont(PinCifra[0][playerid], 3);
	TextDrawSetProportional(PinCifra[0][playerid], 1);
	TextDrawSetSelectable(PinCifra[0][playerid], true);

	PinCifra[1][playerid] = TextDrawCreate(264.444335, 207.573303, "1");
	TextDrawLetterSize(PinCifra[1][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[1][playerid], 2);
	TextDrawColor(PinCifra[1][playerid], -1);
	TextDrawSetShadow(PinCifra[1][playerid], 0);
	TextDrawSetOutline(PinCifra[1][playerid], 1);
	TextDrawBackgroundColor(PinCifra[1][playerid], 51);
	TextDrawFont(PinCifra[1][playerid], 3);
	TextDrawSetProportional(PinCifra[1][playerid], 1);
	TextDrawSetSelectable(PinCifra[1][playerid], true);

	PinCifra[2][playerid] = TextDrawCreate(316.444396, 207.573318, "2");
	TextDrawLetterSize(PinCifra[2][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[2][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[2][playerid], 2);
	TextDrawColor(PinCifra[2][playerid], -1);
	TextDrawSetShadow(PinCifra[2][playerid], 0);
	TextDrawSetOutline(PinCifra[2][playerid], 1);
	TextDrawBackgroundColor(PinCifra[2][playerid], 51);
	TextDrawFont(PinCifra[2][playerid], 3);
	TextDrawSetProportional(PinCifra[2][playerid], 1);
	TextDrawSetSelectable(PinCifra[2][playerid], true);

	PinCifra[3][playerid] = TextDrawCreate(359.999908, 209.066650, "3");
	TextDrawLetterSize(PinCifra[3][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[3][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[3][playerid], 2);
	TextDrawColor(PinCifra[3][playerid], -1);
	TextDrawSetShadow(PinCifra[3][playerid], 0);
	TextDrawSetOutline(PinCifra[3][playerid], 1);
	TextDrawBackgroundColor(PinCifra[3][playerid], 51);
	TextDrawFont(PinCifra[3][playerid], 3);
	TextDrawSetProportional(PinCifra[3][playerid], 1);
	TextDrawSetSelectable(PinCifra[3][playerid], true);

	PinCifra[4][playerid] = TextDrawCreate(264.888824, 249.386657, "4");
	TextDrawLetterSize(PinCifra[4][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[4][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[4][playerid], 2);
	TextDrawColor(PinCifra[4][playerid], -1);
	TextDrawSetShadow(PinCifra[4][playerid], 0);
	TextDrawSetOutline(PinCifra[4][playerid], 1);
	TextDrawBackgroundColor(PinCifra[4][playerid], 51);
	TextDrawFont(PinCifra[4][playerid], 3);
	TextDrawSetProportional(PinCifra[4][playerid], 1);
	TextDrawSetSelectable(PinCifra[4][playerid], true);

	PinCifra[5][playerid] = TextDrawCreate(315.111053, 249.386627, "5");
	TextDrawLetterSize(PinCifra[5][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[5][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[5][playerid], 2);
	TextDrawColor(PinCifra[5][playerid], -1);
	TextDrawSetShadow(PinCifra[5][playerid], 0);
	TextDrawSetOutline(PinCifra[5][playerid], 1);
	TextDrawBackgroundColor(PinCifra[5][playerid], 51);
	TextDrawFont(PinCifra[5][playerid], 3);
	TextDrawSetProportional(PinCifra[5][playerid], 1);
	TextDrawSetSelectable(PinCifra[5][playerid], true);

	PinCifra[6][playerid] = TextDrawCreate(360.888793, 249.884399, "6");
	TextDrawLetterSize(PinCifra[6][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[6][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[6][playerid], 2);
	TextDrawColor(PinCifra[6][playerid], -1);
	TextDrawSetShadow(PinCifra[6][playerid], 0);
	TextDrawSetOutline(PinCifra[6][playerid], 1);
	TextDrawBackgroundColor(PinCifra[6][playerid], 51);
	TextDrawFont(PinCifra[6][playerid], 3);
	TextDrawSetProportional(PinCifra[6][playerid], 1);
	TextDrawSetSelectable(PinCifra[6][playerid], true);

	PinCifra[7][playerid] = TextDrawCreate(264.888824, 291.697784, "7");
	TextDrawLetterSize(PinCifra[7][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[7][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[7][playerid], 2);
	TextDrawColor(PinCifra[7][playerid], -1);
	TextDrawSetShadow(PinCifra[7][playerid], 0);
	TextDrawSetOutline(PinCifra[7][playerid], 1);
	TextDrawBackgroundColor(PinCifra[7][playerid], 51);
	TextDrawFont(PinCifra[7][playerid], 3);
	TextDrawSetProportional(PinCifra[7][playerid], 1);
	TextDrawSetSelectable(PinCifra[7][playerid], true);

	PinCifra[8][playerid] = TextDrawCreate(313.777709, 291.697723, "8");
	TextDrawLetterSize(PinCifra[8][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[8][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[8][playerid], 2);
	TextDrawColor(PinCifra[8][playerid], -1);
	TextDrawSetShadow(PinCifra[8][playerid], 0);
	TextDrawSetOutline(PinCifra[8][playerid], 1);
	TextDrawBackgroundColor(PinCifra[8][playerid], 51);
	TextDrawFont(PinCifra[8][playerid], 3);
	TextDrawSetProportional(PinCifra[8][playerid], 1);
	TextDrawSetSelectable(PinCifra[8][playerid], true);

	PinCifra[9][playerid] = TextDrawCreate(361.333251, 291.199951, "9");
	TextDrawLetterSize(PinCifra[9][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[9][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[9][playerid], 2);
	TextDrawColor(PinCifra[9][playerid], -1);
	TextDrawSetShadow(PinCifra[9][playerid], 0);
	TextDrawSetOutline(PinCifra[9][playerid], 1);
	TextDrawBackgroundColor(PinCifra[9][playerid], 51);
	TextDrawFont(PinCifra[9][playerid], 3);
	TextDrawSetProportional(PinCifra[9][playerid], 1);
	TextDrawSetSelectable(PinCifra[9][playerid], true);

	PinText[playerid] = TextDrawCreate(310.222320, 159.288879, "_");
	TextDrawLetterSize(PinText[playerid], 0.449999, 1.600000);
	TextDrawAlignment(PinText[playerid], 2);
	TextDrawColor(PinText[playerid], -1378294017);
	TextDrawSetShadow(PinText[playerid], 0);
	TextDrawSetOutline(PinText[playerid], 0);
	TextDrawBackgroundColor(PinText[playerid], 51);
	TextDrawFont(PinText[playerid], 1);
	TextDrawSetProportional(PinText[playerid], 1);

-Am create structura, am introdus textdra-urile acum ce face?

-Le facem functionale:


//Cautam publicul OnPlayerClickTextDraw, este posibil sa nu il aveti dar il copiati:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == PinClose[1][playerid])
    {
   		TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
		TextDrawHideForPlayer(playerid,PinVerde[playerid]);
		TextDrawHideForPlayer(playerid,PinRosu[playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
		TextDrawHideForPlayer(playerid,PinText[playerid]);
    	CancelSelectTextDraw(playerid);
    	TogglePlayerControllable(playerid, 1);
    	new string[12];
    	format(string, 32,"____");
		TextDrawSetString(PinText[playerid], string);
    }
    if(clickedid == PinCifra[0][playerid])
    {
        strcat(numberab[playerid],"0");//aici se adauga pe rand cate o cifra la fel si la restul.
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[1][playerid])
    {
        strcat(numberab[playerid],"1");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[2][playerid])
    {
        strcat(numberab[playerid],"2");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[3][playerid])
    {
        strcat(numberab[playerid],"3");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[4][playerid])
    {
        strcat(numberab[playerid],"4");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[5][playerid])
    {
        strcat(numberab[playerid],"5");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[6][playerid])
    {
        strcat(numberab[playerid],"6");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[7][playerid])
    {
        strcat(numberab[playerid],"7");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[8][playerid])
    {
        strcat(numberab[playerid],"8");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[9][playerid])
    {
        strcat(numberab[playerid],"9");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinVerde[playerid])
    {
        if(PlayerData[playerid][pPin] == 0)//aici verificam daca playerul nu are niciun pin in baza de date
        {
			new string[200];
			new addpin = strval(numberab[playerid]);
			PlayerData[playerid][pPin] = addpin;
			format(string, sizeof(string), Bot"Contul tau este acum securizat.Codul pin este: %d.Nu uita sa fac printscreen in caz ca il vei uita(F8).", addpin);
			SCM(playerid, -1, string);
			Update(playerid,pPinu);
			AccountLock[playerid] = 1;
			TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
			TextDrawHideForPlayer(playerid,PinVerde[playerid]);
			TextDrawHideForPlayer(playerid,PinRosu[playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
			TextDrawHideForPlayer(playerid,PinText[playerid]);
	    	TogglePlayerControllable(playerid, 1);
			CancelSelectTextDraw(playerid);
			format(string, 32,"_");
			TextDrawSetString(PinText[playerid], string);

		}
		else
		{
			if(PlayerData[playerid][pPin] == strval(numberab[playerid]))//aici verificam daca, codul din baza de date este identic cu cel introdus
			{
				new string[32];
				SCM(playerid, -1, Bot"Contul tau a fost deblocat cu succes!");
				TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
				TextDrawHideForPlayer(playerid,PinVerde[playerid]);
				TextDrawHideForPlayer(playerid,PinRosu[playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
				TextDrawHideForPlayer(playerid,PinText[playerid]);
		    	TogglePlayerControllable(playerid, 1);
				CancelSelectTextDraw(playerid);
				format(string, 32,"_");
				TextDrawSetString(PinText[playerid], string);
			}
			else{SCM(playerid,-1,"{f24848}Cod pin gresit!");}
		}
    }
    if(clickedid == PinRosu[playerid])
    {
        strdel(numberab[playerid], 0,strval(numberab[playerid]));//aici stergem codul introdus
    }
    return 1;
}

-Bun deci structura a fost facuta, textdraw-urile puse, butoanele functionale, urmatorul pas comenzile.

Pasul III: Comenzile


CMD:setpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] == 0)//verificam daca playerul nu are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF33);
        TogglePlayerControllable(playerid, 0);
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau este deja securizat cu un cod pin tasteaza [/loginpin] pentru a debloca contul!");
    }
    return 1;
}
CMD:loginpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] > 0)//Verificam daca playerul are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF66);
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau nu este securizat cu un cod pin!Tasteaza [/setpin] pentru a seta unul!");
    }
    return 1;
}
CMD:pin(playerid, params[])
{
    return cmd::loginpin(playerid, params);//creem o scurtatura pentru comanda /Loginpin
}

!!!Atentie!!!Eu am folosit procesorul de comenzi LIFE-CMD, comenzile sunt la fel dar scurtatura acea difera, deci daca folositi zcmd veti pune:


CMD:pin(playerid, params[])
{
	return cmd_loginpin(playerid, params);
}

Pasul IV: Tabelul in baza de date

pas 1.png

1.Mergem la tabelul users sau players sau accounts cum aveti voi apoi:

pas 2.png

2.Adaugam un nou rand dupa ultimul

pas 3.png

3.Noul rand va fi de timp int(intreg)cu lungimea de 4, si va avea valoarea 0 pana ce aceasta se va schimba.

 

 

Bun, acesta a fost tutorialul, sper ca ati inteles.

Sper ca veti pastra creditele.

!!!Atentie!!! +1 daca ti-a fost de folos.

 

 

Am facut cum ai zis dar mi-a dar 4 erori uitele:

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 017: undefined symbol "PlayerData"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : warning 215: expression has no effect
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 001: expected token: ";", but found "]"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 029: invalid expression, assumed zero
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Link to comment
Share on other sites

Just now, KenZ0R12341 said:

Am facut cum ai zis dar mi-a dar 4 erori uitele:

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 017: undefined symbol "PlayerData"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : warning 215: expression has no effect
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 001: expected token: ";", but found "]"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : error 029: invalid expression, assumed zero
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4285) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

PlayerData il inlocuiesti cu ce ai tu in gm , PlayerInfo/playerVariables etc

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

2 minutes ago, KenZ0R12341 said:

aaaa ok multumesc de sprijin

pentru putin

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Deci am facut asa nu imi mai da erorile alea imi da altele uite:

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4292) : error 017: undefined symbol "pPinu"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 017: undefined symbol "AccountLock"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : warning 215: expression has no effect
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 001: expected token: ";", but found "]"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 029: invalid expression, assumed zero
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Link to comment
Share on other sites

3 minutes ago, KenZ0R12341 said:

Deci am facut asa nu imi mai da erorile alea imi da altele uite:

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4292) : error 017: undefined symbol "pPinu"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 017: undefined symbol "AccountLock"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : warning 215: expression has no effect
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 001: expected token: ";", but found "]"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : error 029: invalid expression, assumed zero
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(4293) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

creezi un enum unde pui pPinu

enum
{
	pPinu
};

apoi adaugi pe la inceputul gm-ului:

new AcountLock[MAX_PLAYERS];

@KenZ0R12341urmareste tutorialul pas cu pas si nu vei mai primi erori..

Edited by DaEdRiC-FoX

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

La 18.03.2016 la 12:14, DaEdRiC-FoX a spus:

Introducere:

Salutare tuturor, astazi o sa va arat cum se creeaza un sistem de pin.Acesta este ultimul meu tutorial si totodata si ultimul script creat de mine(DaEdRiC-FoX), dupa aceea ma voi retrage din lumea SA:MP-ului.

Pasul I: Structura

-Prima data va trebuie sa punem variabila pinului:


pPin//Aceasta este o variabila la fel ca celelalte : pAdmin,pHelper etc.

Apasam tasta CTRL+F si cautam pAdmin sau orice altceva care face parte din PlayerData/PlayerInfo sau cum aveti voi.

Unii folosesc direct metoda de update in baza de date:


mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Cash`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pCash], playerName);
mysql_query(handle, string);

dar eu prefer sa fac astefel:


//Pun sub enum-ul de la PlayerInfo:
enum
{
	pPinu//ATENTIE!!Nu este pPin ci este pPinu, trebuie sa difere de variabila de la PlayerInfo.Mai puteti pune si pPinx, cum doriti.
};
//Apoi punem la inceputul gm-ului:
forward Update(playerid, type);
//Mergem oriunde in gm si punem:
public Update(playerid, type)//de Update(); ne vom folosi mai tarziu, v-eti intelege.
{
	if(IsPlayerConnected(playerid))
	{
		new string[256];//aici creem un string, sau putem pune query in loc de string.
		new playerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playerName, sizeof(playerName));//Aici cautam numele playerului in cauza.
		{
			switch(type)
			{
				case pPinu:
				{
					mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `Pin`='%d' WHERE `Nume`='%s'", PlayerData[playerid][pPin],playerName);//Aici se va face introducerea in baza de date.
					mysql_query(handle, string);
				}
			}
		}
	}
}

Acum cand vom avea nevoie sa facem update la pin(sa facem introducerea in baza de date pentru cei care nu inteleg)vom pune:


Update(playerid, pPinu);//Se actioneaza collback-ul si se face update in baza de date, fara sa mai scriem altceva in plus

-Bun, apoi va trebui sa facem extragerea Pinului din baza de date:-Mergem la public OnLogin/OnPlayerLogin/WhenPlayerLogin depinde cum aveti voi si punem:


PlayerData[playerid][pPin] = cache_get_field_content_int(0, "Pin");//Aici vom extrage din baza de date pin-ul playerului in cauza.

-Bun acum structura este gata.

Pasul II: Textdraw-urile

-Eu am deja facute textdraw-urile, dar daca voi vreti altele puteti face cu ipleomax.


//Astea trebuie puse la inceputul Gm-ului, definim textdraw-urile.
new Text:PinBox[3][MAX_PLAYERS];
new Text:PinClose[2][MAX_PLAYERS];
new Text:PinVerde[MAX_PLAYERS];
new Text:PinRosu[MAX_PLAYERS];
new Text:PinCifra[10][MAX_PLAYERS];
new Text:PinText[MAX_PLAYERS];
new numberab[MAX_PLAYERS][5];//asta va fi pentru cifre
//Apoi, mergem la publicul OnPlayerConnect si punem textdraw-urile:
	PinBox[0][playerid] = TextDrawCreate(393.999969, 132.913330, "usebox");
	TextDrawLetterSize(PinBox[0][playerid], 0.000000, 26.618642);
	TextDrawTextSize(PinBox[0][playerid], 235.777816, 0.000000);
	TextDrawAlignment(PinBox[0][playerid], 1);
	TextDrawColor(PinBox[0][playerid], 0);
	TextDrawUseBox(PinBox[0][playerid], true);
	TextDrawBoxColor(PinBox[0][playerid], 102);
	TextDrawSetShadow(PinBox[0][playerid], 0);
	TextDrawSetOutline(PinBox[0][playerid], 0);
	TextDrawFont(PinBox[0][playerid], 0);

	PinBox[1][playerid] = TextDrawCreate(386.444427, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[1][playerid], 0.000000, 24.904077);
	TextDrawTextSize(PinBox[1][playerid], 242.000000, 0.000000);
	TextDrawAlignment(PinBox[1][playerid], 1);
	TextDrawColor(PinBox[1][playerid], 0);
	TextDrawUseBox(PinBox[1][playerid], true);
	TextDrawBoxColor(PinBox[1][playerid], 102);
	TextDrawSetShadow(PinBox[1][playerid], 0);
	TextDrawSetOutline(PinBox[1][playerid], 0);
	TextDrawFont(PinBox[1][playerid], 0);

	PinBox[2][playerid] = TextDrawCreate(386.000000, 141.375549, "usebox");
	TextDrawLetterSize(PinBox[2][playerid], 0.000000, 5.767285);
	TextDrawTextSize(PinBox[2][playerid], 242.444442, 0.000000);
	TextDrawAlignment(PinBox[2][playerid], 1);
	TextDrawColor(PinBox[2][playerid], 0);
	TextDrawUseBox(PinBox[2][playerid], true);
	TextDrawBoxColor(PinBox[2][playerid], -2139094785);
	TextDrawSetShadow(PinBox[2][playerid], 0);
	TextDrawSetOutline(PinBox[2][playerid], 0);
	TextDrawFont(PinBox[2][playerid], 0);

	PinClose[0][playerid] = TextDrawCreate(376.888885, 130.915557, "LD_POOL:BALL");
	TextDrawLetterSize(PinClose[0][playerid], 0.000000, 0.000000);
	TextDrawTextSize(PinClose[0][playerid], 15.111114, 16.924453);
	TextDrawAlignment(PinClose[0][playerid], 1);
	TextDrawColor(PinClose[0][playerid], -1);
	TextDrawSetShadow(PinClose[0][playerid], 0);
	TextDrawSetOutline(PinClose[0][playerid], 0);
	TextDrawFont(PinClose[0][playerid], 4);

	PinClose[1][playerid] = TextDrawCreate(385.333374, 131.911132, "X");
	TextDrawLetterSize(PinClose[1][playerid], 0.454444, 1.624888);
	TextDrawTextSize(PinClose[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinClose[1][playerid], 2);
	TextDrawColor(PinClose[1][playerid], -2147483393);
	TextDrawSetShadow(PinClose[1][playerid], 0);
	TextDrawSetOutline(PinClose[1][playerid], 1);
	TextDrawBackgroundColor(PinClose[1][playerid], 51);
	TextDrawFont(PinClose[1][playerid], 2);
	TextDrawSetProportional(PinClose[1][playerid], 1);
	TextDrawSetSelectable(PinClose[1][playerid], true);

	PinVerde[playerid] = TextDrawCreate(272.888916, 341.475646, "OK");
	TextDrawLetterSize(PinVerde[playerid], 0.501111, 1.500444);
	TextDrawTextSize(PinVerde[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinVerde[playerid], 2);
	TextDrawColor(PinVerde[playerid], 16711935);
	TextDrawSetShadow(PinVerde[playerid], 0);
	TextDrawSetOutline(PinVerde[playerid], 1);
	TextDrawBackgroundColor(PinVerde[playerid], 51);
	TextDrawFont(PinVerde[playerid], 3);
	TextDrawSetProportional(PinVerde[playerid], 1);
	TextDrawSetSelectable(PinVerde[playerid], true);

	PinRosu[playerid] = TextDrawCreate(355.555572, 341.475646, "DEL");
	TextDrawLetterSize(PinRosu[playerid], 0.345555, 1.600000);
	TextDrawTextSize(PinRosu[playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinRosu[playerid], 2);
	TextDrawColor(PinRosu[playerid], -16776961);
	TextDrawSetShadow(PinRosu[playerid], 0);
	TextDrawSetOutline(PinRosu[playerid], 1);
	TextDrawBackgroundColor(PinRosu[playerid], 51);
	TextDrawFont(PinRosu[playerid], 3);
	TextDrawSetProportional(PinRosu[playerid], 1);
	TextDrawSetSelectable(PinRosu[playerid], true);

	PinCifra[0][playerid] = TextDrawCreate(315.999908, 341.475646, "0");
	TextDrawLetterSize(PinCifra[0][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[0][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[0][playerid], 2);
	TextDrawColor(PinCifra[0][playerid], -1);
	TextDrawSetShadow(PinCifra[0][playerid], 0);
	TextDrawSetOutline(PinCifra[0][playerid], 1);
	TextDrawBackgroundColor(PinCifra[0][playerid], 51);
	TextDrawFont(PinCifra[0][playerid], 3);
	TextDrawSetProportional(PinCifra[0][playerid], 1);
	TextDrawSetSelectable(PinCifra[0][playerid], true);

	PinCifra[1][playerid] = TextDrawCreate(264.444335, 207.573303, "1");
	TextDrawLetterSize(PinCifra[1][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[1][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[1][playerid], 2);
	TextDrawColor(PinCifra[1][playerid], -1);
	TextDrawSetShadow(PinCifra[1][playerid], 0);
	TextDrawSetOutline(PinCifra[1][playerid], 1);
	TextDrawBackgroundColor(PinCifra[1][playerid], 51);
	TextDrawFont(PinCifra[1][playerid], 3);
	TextDrawSetProportional(PinCifra[1][playerid], 1);
	TextDrawSetSelectable(PinCifra[1][playerid], true);

	PinCifra[2][playerid] = TextDrawCreate(316.444396, 207.573318, "2");
	TextDrawLetterSize(PinCifra[2][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[2][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[2][playerid], 2);
	TextDrawColor(PinCifra[2][playerid], -1);
	TextDrawSetShadow(PinCifra[2][playerid], 0);
	TextDrawSetOutline(PinCifra[2][playerid], 1);
	TextDrawBackgroundColor(PinCifra[2][playerid], 51);
	TextDrawFont(PinCifra[2][playerid], 3);
	TextDrawSetProportional(PinCifra[2][playerid], 1);
	TextDrawSetSelectable(PinCifra[2][playerid], true);

	PinCifra[3][playerid] = TextDrawCreate(359.999908, 209.066650, "3");
	TextDrawLetterSize(PinCifra[3][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[3][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[3][playerid], 2);
	TextDrawColor(PinCifra[3][playerid], -1);
	TextDrawSetShadow(PinCifra[3][playerid], 0);
	TextDrawSetOutline(PinCifra[3][playerid], 1);
	TextDrawBackgroundColor(PinCifra[3][playerid], 51);
	TextDrawFont(PinCifra[3][playerid], 3);
	TextDrawSetProportional(PinCifra[3][playerid], 1);
	TextDrawSetSelectable(PinCifra[3][playerid], true);

	PinCifra[4][playerid] = TextDrawCreate(264.888824, 249.386657, "4");
	TextDrawLetterSize(PinCifra[4][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[4][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[4][playerid], 2);
	TextDrawColor(PinCifra[4][playerid], -1);
	TextDrawSetShadow(PinCifra[4][playerid], 0);
	TextDrawSetOutline(PinCifra[4][playerid], 1);
	TextDrawBackgroundColor(PinCifra[4][playerid], 51);
	TextDrawFont(PinCifra[4][playerid], 3);
	TextDrawSetProportional(PinCifra[4][playerid], 1);
	TextDrawSetSelectable(PinCifra[4][playerid], true);

	PinCifra[5][playerid] = TextDrawCreate(315.111053, 249.386627, "5");
	TextDrawLetterSize(PinCifra[5][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[5][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[5][playerid], 2);
	TextDrawColor(PinCifra[5][playerid], -1);
	TextDrawSetShadow(PinCifra[5][playerid], 0);
	TextDrawSetOutline(PinCifra[5][playerid], 1);
	TextDrawBackgroundColor(PinCifra[5][playerid], 51);
	TextDrawFont(PinCifra[5][playerid], 3);
	TextDrawSetProportional(PinCifra[5][playerid], 1);
	TextDrawSetSelectable(PinCifra[5][playerid], true);

	PinCifra[6][playerid] = TextDrawCreate(360.888793, 249.884399, "6");
	TextDrawLetterSize(PinCifra[6][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[6][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[6][playerid], 2);
	TextDrawColor(PinCifra[6][playerid], -1);
	TextDrawSetShadow(PinCifra[6][playerid], 0);
	TextDrawSetOutline(PinCifra[6][playerid], 1);
	TextDrawBackgroundColor(PinCifra[6][playerid], 51);
	TextDrawFont(PinCifra[6][playerid], 3);
	TextDrawSetProportional(PinCifra[6][playerid], 1);
	TextDrawSetSelectable(PinCifra[6][playerid], true);

	PinCifra[7][playerid] = TextDrawCreate(264.888824, 291.697784, "7");
	TextDrawLetterSize(PinCifra[7][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[7][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[7][playerid], 2);
	TextDrawColor(PinCifra[7][playerid], -1);
	TextDrawSetShadow(PinCifra[7][playerid], 0);
	TextDrawSetOutline(PinCifra[7][playerid], 1);
	TextDrawBackgroundColor(PinCifra[7][playerid], 51);
	TextDrawFont(PinCifra[7][playerid], 3);
	TextDrawSetProportional(PinCifra[7][playerid], 1);
	TextDrawSetSelectable(PinCifra[7][playerid], true);

	PinCifra[8][playerid] = TextDrawCreate(313.777709, 291.697723, "8");
	TextDrawLetterSize(PinCifra[8][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[8][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[8][playerid], 2);
	TextDrawColor(PinCifra[8][playerid], -1);
	TextDrawSetShadow(PinCifra[8][playerid], 0);
	TextDrawSetOutline(PinCifra[8][playerid], 1);
	TextDrawBackgroundColor(PinCifra[8][playerid], 51);
	TextDrawFont(PinCifra[8][playerid], 3);
	TextDrawSetProportional(PinCifra[8][playerid], 1);
	TextDrawSetSelectable(PinCifra[8][playerid], true);

	PinCifra[9][playerid] = TextDrawCreate(361.333251, 291.199951, "9");
	TextDrawLetterSize(PinCifra[9][playerid], 0.449999, 1.600000);
	TextDrawTextSize(PinCifra[9][playerid], 10.000000, 10.000000);
	TextDrawAlignment(PinCifra[9][playerid], 2);
	TextDrawColor(PinCifra[9][playerid], -1);
	TextDrawSetShadow(PinCifra[9][playerid], 0);
	TextDrawSetOutline(PinCifra[9][playerid], 1);
	TextDrawBackgroundColor(PinCifra[9][playerid], 51);
	TextDrawFont(PinCifra[9][playerid], 3);
	TextDrawSetProportional(PinCifra[9][playerid], 1);
	TextDrawSetSelectable(PinCifra[9][playerid], true);

	PinText[playerid] = TextDrawCreate(310.222320, 159.288879, "_");
	TextDrawLetterSize(PinText[playerid], 0.449999, 1.600000);
	TextDrawAlignment(PinText[playerid], 2);
	TextDrawColor(PinText[playerid], -1378294017);
	TextDrawSetShadow(PinText[playerid], 0);
	TextDrawSetOutline(PinText[playerid], 0);
	TextDrawBackgroundColor(PinText[playerid], 51);
	TextDrawFont(PinText[playerid], 1);
	TextDrawSetProportional(PinText[playerid], 1);

-Am create structura, am introdus textdra-urile acum ce face?

-Le facem functionale:


//Cautam publicul OnPlayerClickTextDraw, este posibil sa nu il aveti dar il copiati:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == PinClose[1][playerid])
    {
   		TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
		TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
		TextDrawHideForPlayer(playerid,PinVerde[playerid]);
		TextDrawHideForPlayer(playerid,PinRosu[playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
		TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
		TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
		TextDrawHideForPlayer(playerid,PinText[playerid]);
    	CancelSelectTextDraw(playerid);
    	TogglePlayerControllable(playerid, 1);
    	new string[12];
    	format(string, 32,"____");
		TextDrawSetString(PinText[playerid], string);
    }
    if(clickedid == PinCifra[0][playerid])
    {
        strcat(numberab[playerid],"0");//aici se adauga pe rand cate o cifra la fel si la restul.
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[1][playerid])
    {
        strcat(numberab[playerid],"1");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[2][playerid])
    {
        strcat(numberab[playerid],"2");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[3][playerid])
    {
        strcat(numberab[playerid],"3");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[4][playerid])
    {
        strcat(numberab[playerid],"4");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[5][playerid])
    {
        strcat(numberab[playerid],"5");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[6][playerid])
    {
        strcat(numberab[playerid],"6");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[7][playerid])
    {
        strcat(numberab[playerid],"7");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[8][playerid])
    {
        strcat(numberab[playerid],"8");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinCifra[9][playerid])
    {
        strcat(numberab[playerid],"9");
        TextDrawSetString(PinText[playerid],numberab[playerid]);
    }
    if(clickedid == PinVerde[playerid])
    {
        if(PlayerData[playerid][pPin] == 0)//aici verificam daca playerul nu are niciun pin in baza de date
        {
			new string[200];
			new addpin = strval(numberab[playerid]);
			PlayerData[playerid][pPin] = addpin;
			format(string, sizeof(string), Bot"Contul tau este acum securizat.Codul pin este: %d.Nu uita sa fac printscreen in caz ca il vei uita(F8).", addpin);
			SCM(playerid, -1, string);
			Update(playerid,pPinu);
			AccountLock[playerid] = 1;
			TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
			TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
			TextDrawHideForPlayer(playerid,PinVerde[playerid]);
			TextDrawHideForPlayer(playerid,PinRosu[playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
			TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
			TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
			TextDrawHideForPlayer(playerid,PinText[playerid]);
	    	TogglePlayerControllable(playerid, 1);
			CancelSelectTextDraw(playerid);
			format(string, 32,"_");
			TextDrawSetString(PinText[playerid], string);

		}
		else
		{
			if(PlayerData[playerid][pPin] == strval(numberab[playerid]))//aici verificam daca, codul din baza de date este identic cu cel introdus
			{
				new string[32];
				SCM(playerid, -1, Bot"Contul tau a fost deblocat cu succes!");
				TextDrawHideForPlayer(playerid,PinBox[0][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[1][playerid]);
				TextDrawHideForPlayer(playerid,PinBox[2][playerid]);
				TextDrawHideForPlayer(playerid,PinVerde[playerid]);
				TextDrawHideForPlayer(playerid,PinRosu[playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[0][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[1][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[2][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[3][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[4][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[5][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[6][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[7][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[8][playerid]);
				TextDrawHideForPlayer(playerid,PinCifra[9][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[0][playerid]);
				TextDrawHideForPlayer(playerid,PinClose[1][playerid]);
				TextDrawHideForPlayer(playerid,PinText[playerid]);
		    	TogglePlayerControllable(playerid, 1);
				CancelSelectTextDraw(playerid);
				format(string, 32,"_");
				TextDrawSetString(PinText[playerid], string);
			}
			else{SCM(playerid,-1,"{f24848}Cod pin gresit!");}
		}
    }
    if(clickedid == PinRosu[playerid])
    {
        strdel(numberab[playerid], 0,strval(numberab[playerid]));//aici stergem codul introdus
    }
    return 1;
}

-Bun deci structura a fost facuta, textdraw-urile puse, butoanele functionale, urmatorul pas comenzile.

Pasul III: Comenzile


CMD:setpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] == 0)//verificam daca playerul nu are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF33);
        TogglePlayerControllable(playerid, 0);
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau este deja securizat cu un cod pin tasteaza [/loginpin] pentru a debloca contul!");
    }
    return 1;
}
CMD:loginpin(playerid, params[])
{
    if(PlayerData[playerid][pPin] > 0)//Verificam daca playerul are pin
    {
        TextDrawShowForPlayer(playerid,PinBox[0][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[1][playerid]);
        TextDrawShowForPlayer(playerid,PinBox[2][playerid]);
        TextDrawShowForPlayer(playerid,PinVerde[playerid]);
        TextDrawShowForPlayer(playerid,PinRosu[playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[0][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[1][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[2][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[3][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[4][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[5][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[6][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[7][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[8][playerid]);
        TextDrawShowForPlayer(playerid,PinCifra[9][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[0][playerid]);
        TextDrawShowForPlayer(playerid,PinClose[1][playerid]);
        TextDrawShowForPlayer(playerid,PinText[playerid]);
        SelectTextDraw(playerid, 0xFFFFFF66);
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    else
    {
        SCM(playerid, COLOR_RED, Bot"Contul tau nu este securizat cu un cod pin!Tasteaza [/setpin] pentru a seta unul!");
    }
    return 1;
}
CMD:pin(playerid, params[])
{
    return cmd::loginpin(playerid, params);//creem o scurtatura pentru comanda /Loginpin
}

!!!Atentie!!!Eu am folosit procesorul de comenzi LIFE-CMD, comenzile sunt la fel dar scurtatura acea difera, deci daca folositi zcmd veti pune:


CMD:pin(playerid, params[])
{
	return cmd_loginpin(playerid, params);
}

Pasul IV: Tabelul in baza de date

pas 1.png

1.Mergem la tabelul users sau players sau accounts cum aveti voi apoi:

pas 2.png

2.Adaugam un nou rand dupa ultimul

pas 3.png

3.Noul rand va fi de timp int(intreg)cu lungimea de 4, si va avea valoarea 0 pana ce aceasta se va schimba.

 

 

Bun, acesta a fost tutorialul, sper ca ati inteles.

Sper ca veti pastra creditele.

!!!Atentie!!! +1 daca ti-a fost de folos.

 

 

deci am facut fix cum ai zis tu dar tot imi da eroarea cu AccountLock

aia cu pPinu sa rezolvat

Link to comment
Share on other sites

14 minutes ago, KenZ0R12341 said:

deci am facut fix cum ai zis tu dar tot imi da eroarea cu AccountLock

aia cu pPinu sa rezolvat

ti-am zis, pui la inceputul gm-ului

new AccountLock[MAX_PLAYERS];

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Acum 7 minute, DaEdRiC-FoX a spus:

ti-am zis, pui la inceputul gm-ului


new AccountLock[MAX_PLAYERS];

 

am pus ce mi-ai zis dar imi da erorile astea

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9074) : error 021: symbol already defined: "Update"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9085) : error 017: undefined symbol "handle"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9086) : error 017: undefined symbol "handle"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9091) : warning 209: function "Update" should return a value
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : warning 219: local variable "pPinu" shadows a variable at a preceding level
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : error 025: function heading differs from prototype
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : error 021: symbol already defined: "Update"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(12401) : warning 204: symbol is assigned a value that is never used: "stringlogo"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(42010) : warning 203: symbol is never used: "AcountLock"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
 

Link to comment
Share on other sites

14 minutes ago, KenZ0R12341 said:

am pus ce mi-ai zis dar imi da erorile astea

D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9074) : error 021: symbol already defined: "Update"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9085) : error 017: undefined symbol "handle"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9086) : error 017: undefined symbol "handle"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9091) : warning 209: function "Update" should return a value
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : warning 219: local variable "pPinu" shadows a variable at a preceding level
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : error 025: function heading differs from prototype
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(9093) : error 021: symbol already defined: "Update"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(12401) : warning 204: symbol is assigned a value that is never used: "stringlogo"
D:\New folder\gta sa pentru samp\Gamemode By NexxT\gamemodes\Nigga.pwn(42010) : warning 203: symbol is never used: "AcountLock"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
 

Dacă tu nu știi să rezolvi asemenea erori de ce te mai apuci? Eu v.am făcut tutorial fi.ti măcar în stare să.l implementați în gm,dacă nu știi postezi la ajutor scripting

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

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.