open.mp forum
[Pawn] PlayerTextDrawBoxColor is not work - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] PlayerTextDrawBoxColor is not work (/showthread.php?tid=1355)



PlayerTextDrawBoxColor is not work - Zow - 2020-11-20

When I typed /show and then rCheck only switch me from 0 to 1 and done?
I want them to keep count until the end?
I know my code look stupid but I dont know how to do it in other way

Code:
CMD:show(playerid, params[])
{
? ? PlayerTextDrawShow(playerid, Brandom[playerid]);
? ? PlayerTextDrawShow(playerid, Lrandom[playerid]);
? ? PlayerTextDrawShow(playerid, Mrandom[playerid]);
? ? PlayerTextDrawShow(playerid, Rrandom[playerid]);
? ? Timer[playerid] = SetTimerEx("rCheck", 100, true, "dd", playerid, RCount[playerid]);
return 1;
}

CMD:hide(playerid, params[])
{
? ? PlayerTextDrawHide(playerid, Brandom[playerid]);
? ? PlayerTextDrawHide(playerid, Lrandom[playerid]);
? ? PlayerTextDrawHide(playerid, Mrandom[playerid]);
? ? PlayerTextDrawHide(playerid, Rrandom[playerid]);
? ? KillTimer(Timer[playerid]);
return 1;
}

Hide(playerid)
{
? ? PlayerTextDrawHide(playerid, Lrandom[playerid]);
? ? PlayerTextDrawHide(playerid, Mrandom[playerid]);
? ? PlayerTextDrawHide(playerid, Rrandom[playerid]);
? ? return 1;
}

Show(playerid)
{
? ? PlayerTextDrawShow(playerid, Lrandom[playerid]);
? ? PlayerTextDrawShow(playerid, Mrandom[playerid]);
? ? PlayerTextDrawShow(playerid, Rrandom[playerid]);
? ? return 1;
}

Frandom(playerid)
{
? ? PlayerTextDrawBoxColor(playerid, Lrandom[playerid], -16776961);
? ? PlayerTextDrawBoxColor(playerid, Mrandom[playerid], 115);
? ? PlayerTextDrawBoxColor(playerid, Rrandom[playerid], -16776961);
}

Srandom(playerid)
{
? ? PlayerTextDrawBoxColor(playerid, Lrandom[playerid], 115);
? ? PlayerTextDrawBoxColor(playerid, Mrandom[playerid], -16776961);
? ? PlayerTextDrawBoxColor(playerid, Rrandom[playerid], 115);
}

forward rCheck(playerid, count);
public rCheck(playerid, count)
{
? ? switch(count)
? ? {
? ? ? ? case 0:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 1:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 2:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 3:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 4:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 5:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 6:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 7:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 8:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 9:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 10:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 11:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 12:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Frandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 13:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? Srandom(playerid);
? ? ? ? ? ? Show(playerid);
? ? ? ? }
? ? ? ? case 14:
? ? ? ? {
? ? ? ? ? ? Hide(playerid);
? ? ? ? ? ? KillTimer(Timer[playerid]);
? ? ? ? }
? ? }
? ? RCount[playerid];
? ? return 1;
}