03.02.2018, 16:16
Hi, How to put Textdraw Random?
new PlayerText:WellTD[MAX_PLAYERS][2];//at the top of your gm
new WEllTdTimer[MAX_PLAYERS];//at the top of your gm
public OnPlayerConnect(playerid)
{
WellTD[playerid][0] = CreatePlayerTextDraw(playerid, -0.651468, -0.166672, "LOADSUK:loadsc2");
PlayerTextDrawTextSize(playerid, WellTD[playerid][0], 642.000000, 449.000000);
PlayerTextDrawAlignment(playerid, WellTD[playerid][0], 1);
PlayerTextDrawColor(playerid, WellTD[playerid][0], -1);
PlayerTextDrawSetShadow(playerid, WellTD[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, WellTD[playerid][0], 255);
PlayerTextDrawFont(playerid, WellTD[playerid][0], 4);
PlayerTextDrawSetProportional(playerid, WellTD[playerid][0], 0);
WellTD[playerid][1] = CreatePlayerTextDraw(playerid, -0.651468, -0.166672, "LOADSUK:loadsc3");
PlayerTextDrawTextSize(playerid, WellTD[playerid][1], 642.000000, 449.000000);
PlayerTextDrawAlignment(playerid, WellTD[playerid][1], 1);
PlayerTextDrawColor(playerid, WellTD[playerid][1], -1);
PlayerTextDrawSetShadow(playerid, WellTD[playerid][1], 0);
PlayerTextDrawBackgroundColor(playerid, WellTD[playerid][1], 255);
PlayerTextDrawFont(playerid, WellTD[playerid][1], 4);
PlayerTextDrawSetProportional(playerid, WellTD[playerid][1], 0);
WEllTdTimer[playerid] = SetTimerEx("WellTdCh", 5000, 1, "i", playerid);
return 1;
}
forward WellTdCh(playerid);
public WellTdCh(playerid)
{
switch(random(2))
{
case 0:
{
PlayerTextDrawHide(playerid, WellTD[playerid][1]);
PlayerTextDrawHide(playerid, WellTD[playerid][0]);
PlayerTextDrawShow(playerid, WellTD[playerid][1]);
}
case 1:
{
PlayerTextDrawHide(playerid, WellTD[playerid][1]);
PlayerTextDrawHide(playerid, WellTD[playerid][0]);
PlayerTextDrawShow(playerid, WellTD[playerid][0]);
}
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
KillTimer(WEllTdTimer[playerid]);
PlayerTextDrawHide(playerid, WellTD[playerid][0]);
PlayerTextDrawHide(playerid, WellTD[playerid][1]);
return 1;
}