TextDrawSetString works only for ID 0..
#1

Okay, I've seen that the TextDrawSetString is bugging to me.
It's working to ID 0 but in the rest of the IDs it's not.
I tried everything to fix it but that was with no effect..

This is my code:

pawn Код:
new Text:WantedTimer[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
    WantedTimer[playerid] = TextDrawCreate(505.000000, 411.000000, "Time left: 0");
    return 1;
}
pawn Код:
WantedTime[ID] = GetPlayerWantedLevel(ID) * 10;  //That's from some command that I created.
pawn Код:
forward WantedVariables();
public WantedVariables()
{
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[128];
            new pname[24];
            GetPlayerName(i,pname,sizeof(pname));

            if(GetPlayerWeapon(i) != 0)
            {
                if(WantedTime[i] >= 1)
                {
                    ResetPlayerWeapons(i);
                }
            }

            if(WantedTime[i] > 1)
            {
                format(string,sizeof(string),"Time left: %d",WantedTime);
                TextDrawSetString(Text:WantedTimer[i], string);

                WantedTime[i] --;
            }
            if(WantedTime[i] == 1)
            {
                format(string,sizeof(string),""COL_YELLOW"[JAIL] "COL_WHITE"%s(%d) has been released from the jail, "COL_REASON"reason: Served his sentence.",pname,i);
                SendClientMessageToAll(COLOR_ORANGE,string);
                format(string,sizeof(string),"7[JAIL]%s(%d) has been released from the jail, reason: Served his sentence.",pname,i);

                TotalWantedTime[i] =0;
                WantedTime[i] =0;
                TextDrawHideForPlayer(i,WantedTimer[i]);

                SetPlayerPos(i,225.8451,112.8976,1003.2188);
                SetPlayerFacingAngle(i,1.0816);
                SetCameraBehindPlayer(i);
            }
        }
    }
    return 1;
}

What's the problem with that guys?
Please help me to fix it..
Reply


Messages In This Thread
TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 16:33
Re: TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 18:03
Re: TextDrawSetString works only for ID 0.. - by DaTa[X] - 19.04.2013, 18:08
Re: TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 18:16
Re: TextDrawSetString works only for ID 0.. - by ReVo_ - 19.04.2013, 18:26
Re: TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 18:28
Re: TextDrawSetString works only for ID 0.. - by ReVo_ - 19.04.2013, 18:29
Re: TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 18:32
Re: TextDrawSetString works only for ID 0.. - by ReVo_ - 19.04.2013, 19:15
Re: TextDrawSetString works only for ID 0.. - by alon4210 - 19.04.2013, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)