pawn Код:
public OnPlayerSpawn(playerid)
{
CreateTeamSelectTextDraws(playerid);
PlayerTextDrawShow(playerid,TeamText1[playerid]);
PlayerTextDrawShow(playerid,TeamText2[playerid]);
PlayerTextDrawShow(playerid,TeamText3[playerid]);
PlayerTextDrawShow(playerid,TeamText4[playerid]);
PlayerTextDrawShow(playerid,TeamText5[playerid]);
PlayerTextDrawShow(playerid,TeamText6[playerid]);
PlayerTextDrawShow(playerid,TeamText7[playerid]);
PlayerTextDrawShow(playerid,TeamText8[playerid]);
PlayerTextDrawShow(playerid,TeamText9[playerid]);
PlayerTextDrawShow(playerid,TeamText10[playerid]);
PlayerTextDrawShow(playerid,TeamText11[playerid]);
PlayerTextDrawShow(playerid,TeamText12[playerid]);
PlayerTextDrawShow(playerid,TeamText13[playerid]);
PlayerTextDrawShow(playerid,TeamText14[playerid]);
PlayerTextDrawShow(playerid,TeamText15[playerid]);
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],1);
SelectTextDraw(playerid,0xA3B4C5FF);
switch (PlayerI[playerid][Team])//TVARKYT kai bus started round turi uzdet tamsia spalva o ne sviesia
{
case 0:
{
SetPlayerColor(playerid,TeamI[0][Color]);
SetPlayerSkin(playerid,TeamI[0][Skin]);
}
case 1:
{
SetPlayerColor(playerid,TeamI[1][Color]);
SetPlayerSkin(playerid,TeamI[1][Skin]);
}
case 2:
{
SetPlayerColor(playerid,TeamI[2][Color]);
SetPlayerSkin(playerid,TeamI[2][Skin]);
}
}
PlayerI[playerid][Spawned] = 1;
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid == INVALID_TEXT_DRAW)
{
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],1);
SelectTextDraw(playerid,0x00FF00FF);
}
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(_:playertextid == INVALID_TEXT_DRAW)
{
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],1);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],1);
SelectTextDraw(playerid,0x00FF00FF);
}
if(playertextid == PlayerText:TeamText13[playerid])
{
CancelSelectTextDraw(playerid);
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],0);
PlayerI[playerid][Team] = 0;
if(PlayerI[playerid][InClassSelection] == 1)
{
PlayerI[playerid][InClassSelection] = 0;
PlayerTextDrawHide(playerid,TeamText1[playerid]);
PlayerTextDrawHide(playerid,TeamText2[playerid]);
PlayerTextDrawHide(playerid,TeamText3[playerid]);
PlayerTextDrawHide(playerid,TeamText4[playerid]);
PlayerTextDrawHide(playerid,TeamText5[playerid]);
PlayerTextDrawHide(playerid,TeamText6[playerid]);
PlayerTextDrawHide(playerid,TeamText7[playerid]);
PlayerTextDrawHide(playerid,TeamText8[playerid]);
PlayerTextDrawHide(playerid,TeamText9[playerid]);
PlayerTextDrawHide(playerid,TeamText10[playerid]);
PlayerTextDrawHide(playerid,TeamText11[playerid]);
PlayerTextDrawHide(playerid,TeamText12[playerid]);
PlayerTextDrawHide(playerid,TeamText13[playerid]);
PlayerTextDrawHide(playerid,TeamText14[playerid]);
PlayerTextDrawHide(playerid,TeamText15[playerid]);
DeleteTeamSelectTextDraws(playerid);
}
}
else if(playertextid == PlayerText:TeamText14[playerid])
{
CancelSelectTextDraw(playerid);
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],0);
PlayerI[playerid][Team] = 1;
if(PlayerI[playerid][InClassSelection] == 1)
{
PlayerI[playerid][InClassSelection] = 0;
PlayerTextDrawHide(playerid,TeamText1[playerid]);
PlayerTextDrawHide(playerid,TeamText2[playerid]);
PlayerTextDrawHide(playerid,TeamText3[playerid]);
PlayerTextDrawHide(playerid,TeamText4[playerid]);
PlayerTextDrawHide(playerid,TeamText5[playerid]);
PlayerTextDrawHide(playerid,TeamText6[playerid]);
PlayerTextDrawHide(playerid,TeamText7[playerid]);
PlayerTextDrawHide(playerid,TeamText8[playerid]);
PlayerTextDrawHide(playerid,TeamText9[playerid]);
PlayerTextDrawHide(playerid,TeamText10[playerid]);
PlayerTextDrawHide(playerid,TeamText11[playerid]);
PlayerTextDrawHide(playerid,TeamText12[playerid]);
PlayerTextDrawHide(playerid,TeamText13[playerid]);
PlayerTextDrawHide(playerid,TeamText14[playerid]);
PlayerTextDrawHide(playerid,TeamText15[playerid]);
DeleteTeamSelectTextDraws(playerid);
}
}
else if(playertextid == PlayerText:TeamText15[playerid])
{
CancelSelectTextDraw(playerid);
PlayerTextDrawSetSelectable(playerid,TeamText13[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText14[playerid],0);
PlayerTextDrawSetSelectable(playerid,TeamText15[playerid],0);
PlayerI[playerid][Team] = 2;
if(PlayerI[playerid][InClassSelection] == 1)
{
PlayerI[playerid][InClassSelection] = 0;
PlayerTextDrawHide(playerid,TeamText1[playerid]);
PlayerTextDrawHide(playerid,TeamText2[playerid]);
PlayerTextDrawHide(playerid,TeamText3[playerid]);
PlayerTextDrawHide(playerid,TeamText4[playerid]);
PlayerTextDrawHide(playerid,TeamText5[playerid]);
PlayerTextDrawHide(playerid,TeamText6[playerid]);
PlayerTextDrawHide(playerid,TeamText7[playerid]);
PlayerTextDrawHide(playerid,TeamText8[playerid]);
PlayerTextDrawHide(playerid,TeamText9[playerid]);
PlayerTextDrawHide(playerid,TeamText10[playerid]);
PlayerTextDrawHide(playerid,TeamText11[playerid]);
PlayerTextDrawHide(playerid,TeamText12[playerid]);
PlayerTextDrawHide(playerid,TeamText13[playerid]);
PlayerTextDrawHide(playerid,TeamText14[playerid]);
PlayerTextDrawHide(playerid,TeamText15[playerid]);
DeleteTeamSelectTextDraws(playerid);
}
}
return 1;
}
our textdraws:
TeamText13[playerid] = CreatePlayerTextDraw(playerid,91.000000, 229.000000, "Attackers");
PlayerTextDrawAlignment(playerid,TeamText13[playerid], 2);
PlayerTextDrawBackgroundColor(playerid,TeamText13[playerid], 255);
PlayerTextDrawFont(playerid,TeamText13[playerid], 2);
PlayerTextDrawLetterSize(playerid,TeamText13[playerid], 0.319999, 1.400000);
PlayerTextDrawColor(playerid,TeamText13[playerid], -2113199732);
PlayerTextDrawSetOutline(playerid,TeamText13[playerid], 0);
PlayerTextDrawSetProportional(playerid,TeamText13[playerid], 1);
PlayerTextDrawSetShadow(playerid,TeamText13[playerid], 1);
PlayerTextDrawUseBox(playerid,TeamText13[playerid], 1);
PlayerTextDrawBoxColor(playerid,TeamText13[playerid], 255);
PlayerTextDrawTextSize(playerid,TeamText13[playerid], 0.000000, 72.000000);
PlayerTextDrawSetString(playerid,TeamText13[playerid],TeamI[0][Name]);
TeamText14[playerid] = CreatePlayerTextDraw(playerid,91.000000, 268.000000, "Defenders");
PlayerTextDrawAlignment(playerid,TeamText14[playerid], 2);
PlayerTextDrawBackgroundColor(playerid,TeamText14[playerid], 255);
PlayerTextDrawFont(playerid,TeamText14[playerid], 2);
PlayerTextDrawLetterSize(playerid,TeamText14[playerid], 0.319999, 1.400000);
PlayerTextDrawColor(playerid,TeamText14[playerid], 842183820);
PlayerTextDrawSetOutline(playerid,TeamText14[playerid], 0);
PlayerTextDrawSetProportional(playerid,TeamText14[playerid], 1);
PlayerTextDrawSetShadow(playerid,TeamText14[playerid], 1);
PlayerTextDrawUseBox(playerid,TeamText14[playerid], 1);
PlayerTextDrawBoxColor(playerid,TeamText14[playerid], 255);
PlayerTextDrawTextSize(playerid,TeamText14[playerid], 0.000000, 73.000000);
PlayerTextDrawSetString(playerid,TeamText14[playerid],TeamI[1][Name]);
TeamText15[playerid] = CreatePlayerTextDraw(playerid,91.000000, 306.000000, "Spectator");
PlayerTextDrawAlignment(playerid,TeamText15[playerid], 2);
PlayerTextDrawBackgroundColor(playerid,TeamText15[playerid], 255);
PlayerTextDrawFont(playerid,TeamText15[playerid], 2);
PlayerTextDrawLetterSize(playerid,TeamText15[playerid], 0.319999, 1.400000);
PlayerTextDrawColor(playerid,TeamText15[playerid], -1768515956);
PlayerTextDrawSetOutline(playerid,TeamText15[playerid], 0);
PlayerTextDrawSetProportional(playerid,TeamText15[playerid], 1);
PlayerTextDrawSetShadow(playerid,TeamText15[playerid], 1);
PlayerTextDrawUseBox(playerid,TeamText15[playerid], 1);
PlayerTextDrawBoxColor(playerid,TeamText15[playerid], 255);
PlayerTextDrawTextSize(playerid,TeamText15[playerid], 0.000000, 73.000000);
PlayerTextDrawSetString(playerid,TeamText15[playerid],TeamI[2][Name]);