GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: PeterBlue - 2015. Március 21. - 16:31:05

Cím: Bezárós textdraw
Írta: PeterBlue - 2015. Március 21. - 16:31:05
Van egy bezáró textdrawom(Egy másik textdrawot és magát zárja be), de bárhogy próbálkozok, nem működik. Próbáltam váltani a PlayerText: és a Text: között, de sehogy nem jövök rá...
 
//Önkormányzat adatbázis - Steven Blue
#include <a_samp>
new Text:onkorihatter;
new Text:onkoribezaro;
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Onkormanyzat adatbazis betoltve\");
print(\"--------------------------------------\\n\");
onkoribezaro = TextDrawCreate(240.0,30.0,\"~r~X\");
onkorihatter = TextDrawCreate(30.0,30.0,\" ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~  ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~  ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~  ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~\");
TextDrawUseBox(onkorihatter, 1);
    TextDrawBoxColor(onkorihatter, 0x4DAFE4FF);
    TextDrawTextSize(onkorihatter, 610.0, 450);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerDeath(playerid)
{
TextDrawHideForPlayer(playerid, onkorihatter);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/adatbázis\", cmdtext, true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1777, -1677, 14))
    {
   TextDrawShowForPlayer(playerid,onkorihatter);
   TextDrawShowForPlayer(playerid,Text:onkoribezaro);
   TextDrawSetSelectable(Text:onkoribezaro, 1);
   SelectTextDraw(playerid, 0x00FF00FF);
}
else
{
    SendClientMessage(playerid,0xFFFFFFFF,\"{FF0000}Nem vagy adatbázis közelében!\");
}
return 1;
}
return 0;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == onkoribezaro)
    {
         TextDrawHideForPlayer(playerid, Text:onkoribezaro);
         TextDrawHideForPlayer(playerid, onkorihatter);
         CancelSelectTextDraw(playerid);
    }
    return 1;
}
Cím: Bezárós textdraw
Írta: xXCsucsuXx - 2015. Március 21. - 17:13:23
Mi nem müködik nem zárja be vagy mi?
Cím: Bezárós textdraw
Írta: PeterBlue - 2015. Március 21. - 19:02:59
Nem kattintható, ezáltal nem zárja be.
Cím: Bezárós textdraw
Írta: Mike Freetown - 2015. Március 25. - 13:15:30
Az OnGameModeInit vagy az OnFilterScriptInit-hez másold be ezt:
 
TextDrawSetSelectable(onkoribezaro, true); //Ezzel engedélyezed, hogy rálehessen kattintani
TextDrawSetSelectable(onkorihatter, false); //Ezzel pedig természetesen nem engedélyezed a text-re való kattintást

 
Remélem tudtam segíteni! :)
Cím: Bezárós textdraw
Írta: PeterBlue - 2015. Április 05. - 16:24:30
Ez az eddigiekben is megvolt.