SA-MP Forums Archive
problem with textdraw :( - 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: problem with textdraw :( (/showthread.php?tid=328850)



problem with textdraw :( - Sxriter - 26.03.2012

i make a menu in textdraw in the top of the game to start when the player is connected. The menu never goes away this work perfect. The menu is selectable and when the player tip "Y" running the SelectTextDraw. This work perfect

Here is the problem: when I click an item from the menu (weapons, cars or teleports) should open a new Textdraw without closing the first But this doesn't work, the textdraw with teleports doesn't apear.

here is my code :

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

public OnGameModeInit()
{
    Textdraw0 = TextDrawCreate(74.000000, 6.000000, "teleport");
    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;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

{
    if(newkeys == KEY_YES)
    {
    SelectTextDraw(playerid, 0xFFFFFFAA);
    }
    return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)

{
    if(clickedid == Textdraw0)
    {
    Textdrawstv = TextDrawCreate(3.000000, 26.000000, "list of teleport /ls /lv /sf......");//this doesn't work    
    TextDrawBackgroundColor(Textdrawstv, 255);//this doesn't work
    TextDrawFont(Textdrawstv, 3);//this doesn't work
    TextDrawLetterSize(Textdrawstv, 0.500000, 1.000000);//this doesn't work
    TextDrawColor(Textdrawstv, -1);//this doesn't work
    TextDrawSetOutline(Textdrawstv, 0);//this doesn't work
    TextDrawSetProportional(Textdrawstv, 0);//this doesn't work
    TextDrawSetShadow(Textdrawstv, 1);//this doesn't work
    TextDrawUseBox(Textdrawstv, 1);//this doesn't work
    TextDrawBoxColor(Textdrawstv, 255);//this doesn't work
    TextDrawTextSize(Textdrawstv, 155.000000, 0.000000);//this doesn't work
    CancelSelectTextDraw(playerid);     }
    return 1;
}
help please sorry for my english because i talk spanish


Re : problem with textdraw :( - Ultrascipter - 26.03.2012

Add just:

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)

{
    if(clickedid == Textdraw0)
    {
    TextDrawShowForPlayer(playerid, Textdraw0);
    Textdrawstv = TextDrawCreate(3.000000, 26.000000, "list of teleport /ls /lv /sf......");//this doesn't work    
    TextDrawBackgroundColor(Textdrawstv, 255);//this doesn't work
    TextDrawFont(Textdrawstv, 3);//this doesn't work
    TextDrawLetterSize(Textdrawstv, 0.500000, 1.000000);//this doesn't work
    TextDrawColor(Textdrawstv, -1);//this doesn't work
    TextDrawSetOutline(Textdrawstv, 0);//this doesn't work
    TextDrawSetProportional(Textdrawstv, 0);//this doesn't work
    TextDrawSetShadow(Textdrawstv, 1);//this doesn't work
    TextDrawUseBox(Textdrawstv, 1);//this doesn't work
    TextDrawBoxColor(Textdrawstv, 255);//this doesn't work
    TextDrawTextSize(Textdrawstv, 155.000000, 0.000000);//this doesn't work
    CancelSelectTextDraw(playerid);     }
    return 1;
}

Note: For show TextDraw a player use TextDrawShowForPlayer.



Re: problem with textdraw :( - Sxriter - 26.03.2012

:'D you are the best :') thank you very much


Re : problem with textdraw :( - Ultrascipter - 26.03.2012

Thank's for congratulations