Jump to content

Problema Sistem Crate


Recommended Posts

Salut!

Pentru nelamurirea ta trebuie sa faci o chestie numita INVALID_TEXT_DRAW . Aceasta functie va detecta daca tu apesi ESC sa iti ascunda textdraw-urile (HideTexDraw)

Dar pentru asta voi creea un stock pentru a lucra mai ingrijit, deci avem ceva genul:

TextDraw-urile nostre:

    Tutorial1[playerid] = TextDrawCreate(108.750000, 107.333305, "- Tutorial -~r~ Administratorul~w~ si ~g~Testerul -");
	TextDrawLetterSize(Tutorial1[playerid], 0.449999, 1.600000);
	TextDrawAlignment(Tutorial1[playerid], 1);
	TextDrawColor(Tutorial1[playerid], -1);
	TextDrawSetShadow(Tutorial1[playerid], 0);
	TextDrawSetOutline(Tutorial1[playerid], 1);
	TextDrawBackgroundColor(Tutorial1[playerid], 51);
	TextDrawFont(Tutorial1[playerid], 2);
	TextDrawSetProportional(Tutorial1[playerid], 1);
    
    Descriere0[playerid] = TextDrawCreate(36.250000, 133.583358, "~r~Administratorul ~w~este cel care se ocupa cu decurgerea jocului in liniste fara probleme.");
	TextDrawLetterSize(Descriere0[playerid], 0.294374, 1.599999);
	TextDrawAlignment(Descriere0[playerid], 1);
	TextDrawColor(Descriere0[playerid], -1);
	TextDrawSetShadow(Descriere0[playerid], 0);
	TextDrawSetOutline(Descriere0[playerid], 1);
	TextDrawBackgroundColor(Descriere0[playerid], 51);
	TextDrawFont(Descriere0[playerid], 1);
	TextDrawSetProportional(Descriere0[playerid], 1);

	Descriere1[playerid] = TextDrawCreate(36.875000, 155.750000, "~g~Testerul ~w~este cel care se ocupa cu invatarea si cu scolile roleplay pentru playerii nou-veniti.");
	TextDrawLetterSize(Descriere1[playerid], 0.273124, 1.634999);
	TextDrawAlignment(Descriere1[playerid], 1);
	TextDrawColor(Descriere1[playerid], -1);
	TextDrawSetShadow(Descriere1[playerid], 0);
	TextDrawSetOutline(Descriere1[playerid], 1);
	TextDrawBackgroundColor(Descriere1[playerid], 51);
	TextDrawFont(Descriere1[playerid], 1);
	TextDrawSetProportional(Descriere1[playerid], 1);


Deci pe scurt eu am 3 textdraw-uri de afisat, asta e doar un exemplu.

Voi creea 2 stock-uri cum am spus, unul pentru Show, altul pentru Hide, pentru a vedea si a ascunde td-urile.

Voi crea o restrictie sa vad daca player-ul e cu showtd sau nu. o sa o numesc Restrictie[playerid] = 0 care vine la OnPlayerConnect respectiv in stock-urile noastre.

public OnPlayerConnect(playerid)
{
Restrictie[playerid] = 0;
    return 1;
}

stock ShowTD(playerid)
{
	TextDrawShowForPlayer(playerid, Tutorial1[playerid]);
	TextDrawShowForPlayer(playerid, Descriere0[playerid]);
	TextDrawShowForPlayer(playerid, Descriere1[playerid]);
	Restrictie[playerid] = 1;
}
stock HideTD(playerid)
{
	TextDrawHideForPlayer(playerid, Tutorial1[playerid]);
	TextDrawHideForPlayer(playerid, Descriere0[playerid]);
	TextDrawHideForPlayer(playerid, Descriere1[playerid]);
	Restrictie[playerid] = 0;
}

Acum vom merge la callback-ul OnPlayerClickTextDraw si voi scrie asa:

if(clickedid == INVALID_TEXT_DRAW)
    {
        if(Restrictie[playerid] == 1)
        {
        		HideTD(playerid);
                SendClientMessage(playerid, -1, "Ai apasat tasta {FFCC00}ESC{FFFFFF} si ai inchis meniul(textdraw-urile).");
                return 1;
        }
    }

Atentie!

Daca nu pui restrictiile in stock-uri ai face bine sa le pui in OnPlayerClickTextDraw.

Sper ca te-am ajutat! O seara faina!

Edited by Джо

 

 

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.