How to convert This To TExtdraw ?
#1

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;
                }
Reply
#2

Anyone Please ?
Reply
#3

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 
Reply
#4

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

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 !
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)