18.06.2013, 14:45
hello i just create the radio-textdraw, but i only can click (X) button and another Textdraw cannot here code
pawn Код:
#include <a_samp>
new Showing[MAX_PLAYERS];
new PlayerText:Tekts0[MAX_PLAYERS];
new PlayerText:Tekts1[MAX_PLAYERS];
new PlayerText:Tekts2[MAX_PLAYERS];
new PlayerText:Tekts3[MAX_PLAYERS];
new PlayerText:Tekts4[MAX_PLAYERS];
new PlayerText:Tekts5[MAX_PLAYERS];
new PlayerText:Tekts6[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Tekts0[playerid] = CreatePlayerTextDraw(playerid,236.000000, 139.000000, "Radio By xFirex");
PlayerTextDrawBackgroundColor(playerid,Tekts0[playerid], 255);
PlayerTextDrawFont(playerid,Tekts0[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts0[playerid], 0.549999, 3.099999);
PlayerTextDrawColor(playerid,Tekts0[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts0[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts0[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts0[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts0[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts0[playerid], 65535);
PlayerTextDrawTextSize(playerid,Tekts0[playerid], 362.000000, 49.000000);
Tekts1[playerid] = CreatePlayerTextDraw(playerid,236.000000, 173.000000, "Stop Radio");
PlayerTextDrawBackgroundColor(playerid,Tekts1[playerid], 255);
PlayerTextDrawFont(playerid,Tekts1[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts1[playerid], 0.500000, 1.700000);
PlayerTextDrawColor(playerid,Tekts1[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts1[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts1[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts1[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts1[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts1[playerid], -65281);
PlayerTextDrawTextSize(playerid,Tekts1[playerid], 362.000000, 0.000000);
Tekts2[playerid] = CreatePlayerTextDraw(playerid,236.000000, 194.000000, "++Add Your URL");
PlayerTextDrawBackgroundColor(playerid,Tekts2[playerid], 255);
PlayerTextDrawFont(playerid,Tekts2[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts2[playerid], 0.539999, 1.000000);
PlayerTextDrawColor(playerid,Tekts2[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts2[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts2[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts2[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts2[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts2[playerid], 16711935);
PlayerTextDrawTextSize(playerid,Tekts2[playerid], 362.000000, 0.000000);
Tekts3[playerid] = CreatePlayerTextDraw(playerid,236.000000, 218.000000, "++Add Your URL(STAFF)");
PlayerTextDrawBackgroundColor(playerid,Tekts3[playerid], 255);
PlayerTextDrawFont(playerid,Tekts3[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts3[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,Tekts3[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts3[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts3[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts3[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts3[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts3[playerid], -16776961);
PlayerTextDrawTextSize(playerid,Tekts3[playerid], 362.000000, -1.000000);
Tekts4[playerid] = CreatePlayerTextDraw(playerid,235.000000, 242.000000, "Music/News Radio");
PlayerTextDrawBackgroundColor(playerid,Tekts4[playerid], 255);
PlayerTextDrawFont(playerid,Tekts4[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts4[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,Tekts4[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts4[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts4[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts4[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts4[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts4[playerid], 255);
PlayerTextDrawTextSize(playerid,Tekts4[playerid], 362.000000, 0.000000);
Tekts5[playerid] = CreatePlayerTextDraw(playerid,235.000000, 266.000000, "Stop All Radio");
PlayerTextDrawBackgroundColor(playerid,Tekts5[playerid], 255);
PlayerTextDrawFont(playerid,Tekts5[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts5[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,Tekts5[playerid], -1);
PlayerTextDrawSetOutline(playerid,Tekts5[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts5[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts5[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts5[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts5[playerid], 65535);
PlayerTextDrawTextSize(playerid,Tekts5[playerid], 362.000000, 0.000000);
Tekts6[playerid] = CreatePlayerTextDraw(playerid,368.000000, 139.000000, "(X)");
PlayerTextDrawBackgroundColor(playerid,Tekts6[playerid], 255);
PlayerTextDrawFont(playerid,Tekts6[playerid], 1);
PlayerTextDrawLetterSize(playerid,Tekts6[playerid], 0.500000, 1.400000);
PlayerTextDrawColor(playerid,Tekts6[playerid], -16776961);
PlayerTextDrawSetOutline(playerid,Tekts6[playerid], 0);
PlayerTextDrawSetProportional(playerid,Tekts6[playerid], 1);
PlayerTextDrawSetShadow(playerid,Tekts6[playerid], 1);
PlayerTextDrawUseBox(playerid,Tekts6[playerid], 1);
PlayerTextDrawBoxColor(playerid,Tekts6[playerid], 255);
PlayerTextDrawTextSize(playerid,Tekts6[playerid], 390.000000, 8.000000);
Showing[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/radio"))
{
if(Showing[playerid] == 1)
{
CancelSelectTextDraw(playerid);
Showing[playerid] = 0;
PlayerTextDrawHide(playerid, Tekts0[playerid]);
PlayerTextDrawHide(playerid, Tekts1[playerid]);
PlayerTextDrawHide(playerid, Tekts2[playerid]);
PlayerTextDrawHide(playerid, Tekts3[playerid]);
PlayerTextDrawHide(playerid, Tekts4[playerid]);
PlayerTextDrawHide(playerid, Tekts5[playerid]);
PlayerTextDrawHide(playerid, Tekts6[playerid]);
}
else
{
SelectTextDraw(playerid, 0xFF4040AA);
Showing[playerid] = 1;
PlayerTextDrawSetSelectable(playerid, Tekts1[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tekts2[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tekts3[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tekts4[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tekts5[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Tekts6[playerid], 1);
PlayerTextDrawShow(playerid, Tekts0[playerid]);
PlayerTextDrawShow(playerid, Tekts1[playerid]);
PlayerTextDrawShow(playerid, Tekts2[playerid]);
PlayerTextDrawShow(playerid, Tekts3[playerid]);
PlayerTextDrawShow(playerid, Tekts4[playerid]);
PlayerTextDrawShow(playerid, Tekts5[playerid]);
PlayerTextDrawShow(playerid, Tekts6[playerid]);
}
}
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Tekts1[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
}
if(playertextid == Tekts2[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
}
if(playertextid == Tekts3[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
}
if(playertextid == Tekts4[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
}
if(playertextid == Tekts5[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
}
if(playertextid == Tekts6[playerid])
{
CancelSelectTextDraw(playerid);
PlayerTextDrawHide(playerid, Tekts0[playerid]);
PlayerTextDrawHide(playerid, Tekts1[playerid]);
PlayerTextDrawHide(playerid, Tekts2[playerid]);
PlayerTextDrawHide(playerid, Tekts3[playerid]);
PlayerTextDrawHide(playerid, Tekts4[playerid]);
PlayerTextDrawHide(playerid, Tekts5[playerid]);
PlayerTextDrawHide(playerid, Tekts6[playerid]);
}
return 1;
}