19.04.2013, 16:33
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:
What's the problem with that guys?
Please help me to fix it..
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..