20.05.2012, 07:32
Hello guys. I've got a problem with my textdraws.. After 3-4 hours after the restart they dissappear. I create them on onplayerconnect, destroy them on onplayerdisconnect and update them every second with a custom timer.
Codes:
At top of the script:
In OnPlayerConnect:
In OnPlayerDisconnect:
In a custom timer repeating every second:
Is it wrong that I update them every second?
And, if it helps: After some of them dissappear, the ID of other textdraws mix.. For example i type "/logo on" which sets visible only one textdraw, but sets visible two of them. Or i type "/logo off" to hide a textdraw but it hides another one instead of the one i wanted.
Codes:
At top of the script:
pawn Код:
new Text:TextDrawSZ[MAX_PLAYERS];
In OnPlayerConnect:
pawn Код:
TextDrawSZ[playerid] = TextDrawCreate(89.000000, 430.000000, "SafeZone");
TextDrawAlignment(TextDrawSZ[playerid], 2);
TextDrawBackgroundColor(TextDrawSZ[playerid], 255);
TextDrawFont(TextDrawSZ[playerid], 2);
TextDrawLetterSize(TextDrawSZ[playerid], 0.230000, 1.000000);
TextDrawColor(TextDrawSZ[playerid], -1);
TextDrawSetOutline(TextDrawSZ[playerid], 1);
TextDrawSetProportional(TextDrawSZ[playerid], 1);
TextDrawHideForPlayer(playerid, TextDrawSZ[playerid]);
pawn Код:
TextDrawDestroy(TextDrawSZ[playerid]);
pawn Код:
if(IsPlayerInArea(i, 1432.823, 1546.908, -2360.873, -2234.546) || IsPlayerInArea(i, 1402.4, 1577.33, -1863.458, -1737.13) || IsPlayerInArea(i, 1444.231, 1535.499, -1745.026, -1602.907) || IsPlayerInArea(i, 1398.597, 1516.485, -1038.38, -991.0071)) { TextDrawShowForPlayer(i, TextDrawSZ[i]); TextDrawShowForPlayer(i, TextDrawSZ1[i]); if(AdminDuty[i] == 0 && !IsACop(i) && !IsAMedic(i)) SetPlayerArmedWeapon(i,0); }
And, if it helps: After some of them dissappear, the ID of other textdraws mix.. For example i type "/logo on" which sets visible only one textdraw, but sets visible two of them. Or i type "/logo off" to hide a textdraw but it hides another one instead of the one i wanted.