Originally Posted by IlanZ
Ja que й TextDraw, e nгo PlayerTextDraw, Por quer nгo colocou as textdraw em OnGameModeInit?
No caso bota em OnGameModeInit
PHP код:
public OnGameModeInit()
{
TextdrawM0[playerid] = TextDrawCreate(126.250000, 113.583320, "Lista_de_Minigames");
TextDrawLetterSize(TextdrawM0[playerid], 0.300000, 1.399999);
TextDrawTextSize(TextdrawM0[playerid], 519.000000, 0.000000);
TextDrawAlignment(TextdrawM0[playerid], 1);
TextDrawColor(TextdrawM0[playerid], -1);
TextDrawUseBox(TextdrawM0[playerid], 1);
TextDrawBoxColor(TextdrawM0[playerid], 120);
TextDrawSetShadow(TextdrawM0[playerid], 0);
TextDrawSetOutline(TextdrawM0[playerid], 1);
TextDrawBackgroundColor(TextdrawM0[playerid], 255);
TextDrawFont(TextdrawM0[playerid], 1);
TextDrawSetProportional(TextdrawM0[playerid], 1);
TextDrawSetShadow(TextdrawM0[playerid], 0);
// Aqui no final bota os TextDrawSetSelectable
TextDrawSetSelectable(TextdrawM1[playerid], 1);
TextDrawSetSelectable(TextdrawM2[playerid], 1);
TextDrawSetSelectable(TextdrawM3[playerid], 1);
// ...
return 1;
}
E pra que botar MAX_PLAYERS Em textdraw global e nгo per players? (PlayerTextDraw)
E tira os [playerid] do codigo das textdraw, exemplo:
PHP код:
MostrarMinigames(playerid)
{
TextDrawShowForPlayer(playerid, TextdrawM0);
TextDrawShowForPlayer(playerid, TextdrawM1);
TextDrawShowForPlayer(playerid, TextdrawM2);
TextDrawShowForPlayer(playerid, TextdrawM3);
TextDrawShowForPlayer(playerid, TextdrawM4);
TextDrawShowForPlayer(playerid, TextdrawM5);
TextDrawShowForPlayer(playerid, TextdrawM6);
TextDrawShowForPlayer(playerid, TextdrawM7);
TextDrawShowForPlayer(playerid, TextdrawM8);
hud_minigames[playerid] = true;
}
SumirMinigames(playerid)
{
TextDrawHideForPlayer(playerid, TextdrawM0);
TextDrawHideForPlayer(playerid, TextdrawM1);
TextDrawHideForPlayer(playerid, TextdrawM2);
TextDrawHideForPlayer(playerid, TextdrawM3);
TextDrawHideForPlayer(playerid, TextdrawM4);
TextDrawHideForPlayer(playerid, TextdrawM5);
TextDrawHideForPlayer(playerid, TextdrawM6);
TextDrawHideForPlayer(playerid, TextdrawM7);
TextDrawHideForPlayer(playerid, TextdrawM8);
hud_minigames[playerid] = false;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == TextdrawM1)
{
ChatMsg(playerid, -1, "Funcionou");
CancelSelectTextDraw(playerid);
}
if(clickedid == TextdrawM2)
{
ChatMsg(playerid, -1, "Funcionou kkkj");
CancelSelectTextDraw(playerid);
}
if(clickedid == TextdrawM3)
{
ChatMsg(playerid, -1, "Funcionou kkkj");
CancelSelectTextDraw(playerid);
}
// ...
return 1;
}
|