KillTimer problem ? - 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: KillTimer problem ? (
/showthread.php?tid=414155)
KillTimer problem ? -
gabyk - 08.02.2013
pawn Код:
if ( F_STEPS [ playerid ] == 0 ) {
F_STEPS [ playerid ] = 1;
TextDrawBoxColor ( F_SCREEN, 0x00000000 );
TextDrawShowForPlayer ( playerid, F_SCREEN );
F_TIMER [ playerid ] = SetTimerEx_( "FADE_TIMER", 0, 50, -1, "i", playerid );
}
This script is into OnPlayerDeath..
pawn Код:
Func:FADE_TIMER ( playerid )
{
switch ( F_STEPS [ playerid ] )
{
case 1: TextDrawBoxColor( F_SCREEN, 0x00000011 );
case 2: TextDrawBoxColor( F_SCREEN, 0x00000022 );
case 3: TextDrawBoxColor( F_SCREEN, 0x00000033 );
case 4: TextDrawBoxColor( F_SCREEN, 0x00000044 );
case 5: TextDrawBoxColor( F_SCREEN, 0x00000055 );
case 6: TextDrawBoxColor( F_SCREEN, 0x00000066 );
case 7: TextDrawBoxColor( F_SCREEN, 0x00000077 );
case 8: TextDrawBoxColor( F_SCREEN, 0x00000088 );
case 9: TextDrawBoxColor( F_SCREEN, 0x00000099 );
case 10: TextDrawBoxColor( F_SCREEN, 0x000000AA );
case 11: TextDrawBoxColor( F_SCREEN, 0x000000BB );
case 12: TextDrawBoxColor( F_SCREEN, 0x000000CC );
case 13: TextDrawBoxColor( F_SCREEN, 0x000000DD );
case 14: TextDrawBoxColor( F_SCREEN, 0x000000EE );
case 15:
{
TextDrawBoxColor( F_SCREEN, 0x000000FF );
KillTimer_( F_TIMER [ playerid ] );
F_STEPS [ playerid ] = 0;
}
}
TextDrawHideForPlayer ( playerid, F_SCREEN );
TextDrawShowForPlayer ( playerid, F_SCREEN );
printf ( "#FADE_TIMER ( %d ) called", playerid );
return F_STEPS [ playerid ]++;
}
I use fixes2, but i can't destroy this timer.. the textdraw fade non-stop.
And i have a KillTimer_ in onplayerdisconnect, when i leave from server, the timer don't death.
I have others timers, but i can destroy..
Where is the problem? Possible bug ?
Re: KillTimer problem ? -
gabyk - 08.02.2013
resolved..