SA-MP Forums Archive
help with OnPlayerClickTextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with OnPlayerClickTextDraw (/showthread.php?tid=328486)



help with OnPlayerClickTextDraw - Sxriter - 25.03.2012

Hi i need help, i made a textdraw0 (it's works perfect) it's a menu in the top of the game. this menu say "Server info" and i put OnPlayerClickTextDraw so that when you click you can open other textdraw and give the server info, but does not run the TextDraw
here is the code:

pawn Код:
new Text:Textdraw0;
new Text:Textdrawstv;

public OnGameModeInit()//this work perfect
{
    Textdraw0 = TextDrawCreate(74.000000, 6.000000, "server****");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.369998, 1.399999);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 0);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 23295);
    TextDrawTextSize(Textdraw0, 643.000000, -56.000000);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)//this work
{
    if(newkeys == KEY_YES) //if player type "Y"...
    {
    SelectTextDraw(playerid, 0xFFFFFFAA);
    }
    return 1;
}



public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Textdraw0)//this doesn't work :'( help me
    {
    Textdrawstv = TextDrawCreate(3.000000, 26.000000, "ServerInfo");
    TextDrawBackgroundColor(Textdrawstv, 255);
    TextDrawFont(Textdrawstv, 3);
    TextDrawLetterSize(Textdrawstv, 0.500000, 1.000000);
    TextDrawColor(Textdrawstv, -1);
    TextDrawSetOutline(Textdrawstv, 0);
    TextDrawSetProportional(Textdrawstv, 0);
    TextDrawSetShadow(Textdrawstv, 1);
    TextDrawUseBox(Textdrawstv, 1);
    TextDrawBoxColor(Textdrawstv, 255);
    TextDrawTextSize(Textdrawstv, 155.000000, 0.000000);
    CancelSelectTextDraw(playerid);
    }
    return 1;
}
if the code is wrong, give me a basic code so I edit this or help me correct the code


"sorry for my bad english"


Re: help with OnPlayerClickTextDraw - freddy smyth - 25.03.2012

It's not InitTextDraw instead of SelectTextDraw,

Is it?


Re: help with OnPlayerClickTextDraw - Sxriter - 25.03.2012

https://sampwiki.blast.hk/wiki/SelectTextdraw
I think not


Re: help with OnPlayerClickTextDraw - MP2 - 25.03.2012

You need to use TextDrawSetSelectable.


Re : help with OnPlayerClickTextDraw - Ultrascipter - 25.03.2012

Yes.. Forgets

Change to OnGameModeInit as its:

Код:
public OnGameModeInit()//this work perfect
{
    Textdraw0 = TextDrawCreate(74.000000, 6.000000, "server****");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.369998, 1.399999);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 0);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 23295);
    TextDrawTextSize(Textdraw0, 643.000000, -56.000000);
    TextDrawSetSelectable (Textdraw0 , 1);
    return 1;
}



Re: help with OnPlayerClickTextDraw - Sxriter - 25.03.2012

thank's us