Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. Rockyz

    isTimer bug ?

    i don't see any problem.
  2. اكتب في اف 8 debugscript 3
  3. Rockyz

    isTimer bug ?

    myTimers = { }; addEventHandler ( 'onPlayerCommand', root, function ( cmd ) if ( cmd == 'timer' ) then if ( isTimer ( myTimers [ source ] ) ) then killTimer ( myTimers [ source ] ) myTimers [ source ] = nil outputChatBox ( 'off!', source, 255, 0, 0, true ) else myTimers [ source ] = setTimer ( function ( ) end, 60000, 0 ) outputChatBox ( 'on!', source, 0, 255, 0, true ) end end end )
  4. Well, i'm not sure what are you trying to do, but that's an example : playerTick, Seconds = { }, 3; addCommandHandler ( 'allowed', function ( plr, cmd ) if ( playerTick [ plr ] and playerTick [ plr ] + ( Seconds * 1000 ) > getTickCount ( ) ) then outputChatBox ( 'Please Wait', plr, 255, 0, 0, true ) else outputChatBox ( 'Every Thing is Okay', plr, 0, 255, 0, true ) playerTick [ plr ] = getTickCount ( ) end end );
  5. انت راسل سترنق في التريقر و setElementData يقبل الألمنتات فقط
  6. Rockyz

    help [xml]

    #edit : use xmlUnloadFile after inserting items on the table
  7. على مايبدو انك استخدمت مترجم قوقل في كلمة 'kick'
  8. Rockyz

    help [xml]

    I didn't understand what are you trying to do but, that's an example : function getFolderNameAndScripts ( folder ) local script = ':' .. folder if ( fileExists ( script .. '/meta.xml' ) ) then scriptInfo = { }; local resourceMeta = xmlLoadFile ( script .. '/meta.xml' ) if ( resourceMeta ) then for k, info in pairs ( xmlNodeGetChildren ( resourceMeta ) ) do if ( xmlNodeGetName ( info ) == 'script' or xmlNodeGetName ( info ) == 'file' or xmlNodeGetName ( info ) == 'map' ) then table.insert ( scriptInfo, { script, xmlNodeGetAttribute ( info, 'src' ) or 'N/A', xmlNodeGetAttribute ( info, 'type' ) or 'N/A' } ) end end end end return scriptInfo or { }; end addEventHandler ( 'onResourceStart', root, function ( res ) outputChatBox ( 'The Resource ' .. getResourceName ( res ) .. ' has been started', root, 0, 255, 0, true ) outputChatBox ( 'Resource Scripts :', root, 255, 0, 0, true ) local items = getFolderNameAndScripts ( getResourceName ( res ) ) for i = 1, #items do local t = items [ i ] outputChatBox ( t [ 1 ]:gsub ( ':', 'resources/' ) .. '/' .. t [ 2 ] .. ', type = ' .. t [ 3 ], root, 0, 0, 255, true ) end end )
  9. تأكد انه سيرفر سايد وأكتب /debugscript 3 وشوف وش يطلع لك
  10. بس استخدم الكود هذا اذا ماعندك فري روم : addEventHandler ( 'onPlayerChat', root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then cancelEvent ( ); outputChatBox ( '[Login-System]#ffffffYou should login to talk in chat . ', source, 255, 255, 0, true ) end end );
  11. اجربه ليش يعني مثلا ؟ انت مجربه بنفسك ؟ طيب وش المشكلة ؟؟ اذا جربته بنفسك اكيد بيشتغل لأنك الوحيد الموجود في السيرفر + حتى لو انك مو بنفسك وفي احد معك في السيرفر مو مسجل بيطلع لك الرسالة لأنك تتحقق من الكل اذا هم مسجلين او لا كودك غلط لأنك تتحقق من الكل addEventHandler ( 'onPlayerChat', root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then cancelEvent ( ); outputChatBox ( '[Login-System]#ffffffYou should login to talk in chat . ', source, 255, 255, 0, true ) end end ); + تأكد انه في السيرفر سايد
  12. الوب ماله داعي الكود غلط انت كذا تتحقق من الكل + اذا انت مسوي لوب ليه حاط في فنكشن outputChatBox source
  13. جرب تنسخ احرف مع ارقام مع بعض والصقهم وشوف
  14. @xX_Ma[D]arA_xX @Deativated @#MR.NaiF كلكم غلط استخدم الطريقة هذي : ______________ @#MR.NaiF طريقتك تقدر تقول انها صح لكن لنفترض اني لصقت كلام من ctrl + v كذا بيمسح الأشياء الي في النهاية بس
  15. تعديل على المثال الي فوق ^ local sPos = { guiGetScreenSize ( ) }; GUIEditor = { window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow( ( sPos [ 1 ] - 520 ) / 2, ( sPos [ 2 ] - 452 ) / 2, 520, 452, "Flashing window", false) guiWindowSetSizable(GUIEditor.window[1], false) btn = guiCreateButton(50, 50, 50, 50, '', false, GUIEditor.window[1]) guiCreateAnimation ( GUIEditor.window[1], true, 0.5 ) guiSetFlashing ( GUIEditor.window[1], true ) outputChatBox 'Start !' setTimer ( function ( ) guiSetFlashing ( GUIEditor.window[1], false ) outputChatBox 'Finish !' end, 5000, 1 ) end ) local flasherEvent = { }; function guiSetFlashing ( wnd, state ) if ( state ) then flasherEvent [ wnd ] = function ( state ) if ( source == wnd ) then guiCreateAnimation ( wnd, not state, 0.5 ) end end addEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, flasherEvent [ wnd ] ) else if ( flasherEvent [ wnd ] ) then removeEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, flasherEvent [ wnd ] ) end end end ____ Example 2: local sPos = { guiGetScreenSize ( ) }; local wordsTable = { { 'Hi', 'Hello !' }, { 'Bye', 'Good Bye !' }, { 'Wow !', 'Nice !' }, { '', '????' }, }; GUIEditor = { window = {} } addEventHandler('onClientResourceStart', resourceRoot, function() GUIEditor.window[1] = guiCreateWindow( ( sPos [ 1 ] - 500 ) / 2, ( sPos [ 2 ] - 500 ) / 2, 500, 500, 'My window', false) guiWindowSetSizable(GUIEditor.window[1], false) btn = guiCreateButton(50, 50, 50, 50, '', false, GUIEditor.window[1]) btn1 = guiCreateButton( 500 / 2, 500 / 2, 50, 50, '', false, GUIEditor.window[1]) guiSetVisible ( GUIEditor.window[1], false ) addEventHandler ( 'onClientGUIClick', btn, text, false ) addEventHandler ( 'onClientGUIClick', btn1, text, false ) end ) bindKey ( 'F5', 'down', function ( ) local b = guiCreateAnimation ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ), 0.5 ) if ( b ) then guiSetEnabled ( GUIEditor.window[1], false ) outputChatBox'DONE' else outputChatBox'Please Wait' end end ) addEventHandler ( 'onClientGUIAnimationEnd', resourceRoot, function ( openState ) if ( source == GUIEditor.window[1] ) then local mathRandom = wordsTable [ math.random ( #wordsTable ) ] guiSetText ( btn, mathRandom [ 1 ] ) guiSetText ( btn1, mathRandom [ 2 ] ) guiSetEnabled ( GUIEditor.window[1], true ) showCursor ( openState ) end end ) function text ( ) outputChatBox ( '1 : ' .. guiGetText ( btn ), math.random ( 255 ), math.random ( 255 ), math.random ( 255 ), true ) outputChatBox ( '2 : ' .. guiGetText ( btn1 ), math.random ( 255 ), math.random ( 255 ), math.random ( 255 ), true ) end
  16. استخدم فنكشني .. https://forum.multitheftauto.com/topic/42698-تحت-التطوير-كود-useful-arab-functions/?do=findComment&comment=881361
×
×
  • Create New...