SA-MP Forums Archive
How to convert This To TExtdraw ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to convert This To TExtdraw ? (/showthread.php?tid=517323)



How to convert This To TExtdraw ? - rockhopper - 04.06.2014

This is my jail timer i want it to be a text draw instead of Gametext How to do it ?
Код:
public JailTimer()
{
        for(new i=0; i<MAX_PLAYERS; i++)
        
        {
            if(IsPlayerConnected(Tid))
            {
                if(JAIL[i] > 1)
                {
                    JAIL[i] --; // Decreasing time
                    new time[20]; //adding time variable
                    format(time,sizeof(time),"JAIL Time: %d",JAIL[i]);
                    GameTextForPlayer(Tid,time,500,3);
				}
                if(JAIL[i] == 1) 
                {
                    JAIL[i] =0;
                    SendClientMessage(Tid,COLOR_RED,"You have Completed Your Jail Time!");
                    SetPlayerPos(Tid,252.7439,87.5552,1002.4453);
                    SetPlayerVirtualWorld(Tid, 199);
                    SetPlayerInterior(Tid, 6);

                }
                }
                }
                return 1;
                }



Re: How to convert This To TExtdraw ? - rockhopper - 04.06.2014

Anyone Please ?


Re : How to convert This To TExtdraw ? - S4t3K - 04.06.2014

Instead of the gametext, create a textdraw and show it to a player, for example

PHP код:

new PlayerText:jailTd[MAX_PLAYERS];

public 
jailTimer()
{
     for(new 
i=0i<MAX_PLAYERSi++)
        
        {
            if(
IsPlayerConnected(Tid))
            {
                if(
JAIL[i] > 1)
                {
                    
JAIL[i] --; // Decreasing time
                    
new time[20]; //adding time variable
                    
format(time,sizeof(time),"JAIL Time: %d",JAIL[i]);
                     
jailTd[i] = CreatePlayerTextDraw(i320.0240.0time);
                     
PlayerTextDrawShow(ijailTd[i]);
                     
// Rest of your code 



Re: How to convert This To TExtdraw ? - rockhopper - 04.06.2014

But shouldn't This PlayerTextDrawShow(i, jailTd[i]); Be this PlayerTextDrawShow(Tid, jailTd[i]);


Re : How to convert This To TExtdraw ? - S4t3K - 04.06.2014

Tid comes from nowhere.
Your loop loops around the connected players and each connected player id is "i", not Tid.
The var isn't even created !


Re: How to convert This To TExtdraw ? - rockhopper - 04.06.2014

Ok Thanks But i Just want It to Show For The player Who has been Arrested Ill try n Update You Just a SeC


Re: How to convert This To TExtdraw ? - rockhopper - 04.06.2014

Thanks Bro Worked new playerinfo[playerid][reputation] ++;