Szerző Téma: OnPlayerClickTextDraw  (Megtekintve 769 alkalommal)

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
OnPlayerClickTextDraw
« Dátum: 2012. június 07. - 14:45:42 »
0 Show voters
Csõ all!
Ma írtam egy teszt scriptet, íme:
 
#include <a_samp>
#include <zcmd>
new Text:SpecBox;
new Text:Next;
new Text:Previous;
new Text:SpecOff;
new Text:Name;
public OnFilterScriptInit()
{
SpecBox = TextDrawCreate(233.000000, 328.000000, \"_\");
TextDrawBackgroundColor(SpecBox, 255);
TextDrawFont(SpecBox, 1);
TextDrawLetterSize(SpecBox, 0.500000, 4.299999);
TextDrawColor(SpecBox, -1);
TextDrawSetOutline(SpecBox, 0);
TextDrawSetProportional(SpecBox, 1);
TextDrawSetShadow(SpecBox, 1);
TextDrawUseBox(SpecBox, 1);
TextDrawBoxColor(SpecBox, 858993695);
TextDrawTextSize(SpecBox, 421.000000, 0.000000);
Next = TextDrawCreate(347.000000, 353.000000, \"NEXT >>\");
TextDrawBackgroundColor(Next, 255);
TextDrawFont(Next, 2);
TextDrawLetterSize(Next, 0.410000, 0.799999);
TextDrawColor(Next, 16777215);
TextDrawSetOutline(Next, 1);
TextDrawSetProportional(Next, 1);
Previous = TextDrawCreate(232.000000, 353.000000, \"<< previous\");
TextDrawBackgroundColor(Previous, 255);
TextDrawFont(Previous, 2);
TextDrawLetterSize(Previous, 0.230000, 0.899999);
TextDrawColor(Previous, 16777215);
TextDrawSetOutline(Previous, 1);
TextDrawSetProportional(Previous, 1);
SpecOff = TextDrawCreate(273.000000, 329.000000, \"Speccing off\");
TextDrawBackgroundColor(SpecOff, 255);
TextDrawFont(SpecOff, 1);
TextDrawLetterSize(SpecOff, 0.470000, 1.000000);
TextDrawColor(SpecOff, -16776961);
TextDrawSetOutline(SpecOff, 1);
TextDrawSetProportional(SpecOff, 1);
TextDrawSetSelectable(SpecOff, 1);
Name = TextDrawCreate(315.000000, 341.000000, \"a\");
TextDrawBackgroundColor(Name, 255);
TextDrawFont(Name, 1);
TextDrawLetterSize(Name, 0.350000, 0.899999);
TextDrawColor(Name, -1);
TextDrawSetOutline(Name, 1);
TextDrawSetProportional(Name, 1);
TextDrawSetSelectable(SpecBox, false);
TextDrawSetSelectable(Next, true);
TextDrawSetSelectable(Previous, true);
TextDrawSetSelectable(SpecOff, true);
TextDrawSetSelectable(Name, false);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(SpecBox);
TextDrawDestroy(SpecBox);
TextDrawHideForAll(Next);
TextDrawDestroy(Next);
TextDrawHideForAll(Previous);
TextDrawDestroy(Previous);
TextDrawHideForAll(SpecOff);
TextDrawDestroy(SpecOff);
TextDrawHideForAll(Name);
TextDrawDestroy(Name);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
CMD:specing(playerid) {
TextDrawShowForPlayer(playerid, SpecBox);
TextDrawShowForPlayer(playerid, Next);
TextDrawShowForPlayer(playerid, Previous);
TextDrawShowForPlayer(playerid, SpecOff);
TextDrawShowForPlayer(playerid, Name);
SelectTextDraw(playerid, 0x99FFFFAA);
return 1;
}
CMD:specingoff(playerid) {
TextDrawHideForPlayer(playerid, SpecBox);
TextDrawHideForPlayer(playerid, Next);
TextDrawHideForPlayer(playerid, Previous);
TextDrawHideForPlayer(playerid, SpecOff);
TextDrawHideForPlayer(playerid, Name);
    CancelSelectTextDraw(playerid);
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid != SpecBox)
    {
    if(clickedid == SpecOff)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, \"Spec offolva!\");
//         CancelSelectTextDraw(playerid);
    }
    else if(clickedid == Next)
    {
          SendClientMessage(playerid, 0xFFFFFFAA, \"Megnyomtad a Next gombot!\");
//         CancelSelectTextDraw(playerid);
    }
    else if(clickedid == Previous)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, \"Megnyomtad a Previous gombot!\");
//         CancelSelectTextDraw(playerid);
    }
    }
    return 1;
}

 
Ez a ClickTextdraw, és ezzel az a baj hogy rámegyek a Next-re, vagy spectating off-ra vagy bármelyikre akkor is ezt írja:
Spec offolva!

OnPlayerClickTextDraw
« Válasz #1 Dátum: 2012. június 07. - 15:32:36 »
+1 Show voters
A TextDrawTextSize-al kell beállítani,hogy hol lehsenn rákattintani a textdrawra!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal