killTimer الاسم الصحيح
اولا الساينتكس حق الفنكشن
killTimer
Shared function
This function allows you to kill/halt existing timers.
Syntax
bool killTimer ( timer theTimer )
OOP Syntax Help! I don't understand this!
Method: timer:destroy(...)
Required Arguments
theTimer: The timer you wish to halt.
Returns
Returns true if the timer was successfully killed, false if no such timer existed.
============================================================
بكل بساطه الفنكشن بيقتل التايمر اللي شغال لو ما في تايمر بيرجع فولس
: مثال ( 1 )ء
timer = setTimer( function( ) outputChatBox( 'test' ) end , 1000 , 0 )
addCommandHandler( '1' ,
function( )
killTimer( timer )
end
)
-- لو تلاحظ كل ثانية يطلع كلمة تيست بس بعد ما تكتب كلمة 1 في اف 8 التايمر ينتهي وبالتالي ما تطلع الرسالة
: مثال ( 2 )ء
addCommandHandler( '2' ,
function( player )
if ( isTimer( time ) == false ) then
time = setTimer( function( p ) killPed( p ) end , 1000 , 0 , player )
outputChatBox( 'تم اعادة تشغيل التايمر' , player , 255 , 0 , 0 , true )
else
killTimer( time )
outputChatBox( 'تم انهاء التايمر' , player , 0 , 255 , 0 , true )
end
end
)
-- لما تكتب 2 في اف 8 لو التايمر موجود ينتهي عن طريق فنكشن كيل تايمر
: مثال ( 3 )ء
timer1 = setTimer( function( ) outputChatBox( 'timer1' ) end , 1000 , 0 )
timer2 = setTimer( function( ) outputChatBox( 'timer2' ) end , 1000 , 0 )
timer3 = setTimer( function( ) outputChatBox( 'timer3' ) end , 1000 , 0 )
addCommandHandler( '3' ,
function( p )
for _ , timer in ipairs( getTimers( ) ) do
killTimer( timer )
outputChatBox( 'تم ايقاف جميع التايمرات' , p , 255 , 0 , 0 , true )
end
end
)
-- لما تكتب 3 في اف 8 يوقف جميع التايمرات الموجودة في السكريبت