Jump to content

jafar

Members
  • Posts

    1,434
  • Joined

  • Last visited

Everything posted by jafar

  1. وش يعني num ??? متغير انت تسويه , ترمز اليه بأي اسم مثلاً : TheKing وفايدته في ذا الكود انه هو الي يحدد وقت المهمة ^^
  2. الباقي عن الوقت , استخدم متغير وتايمر والالمنت داتا , مثلاً : -- Server Side ! num = 100 -- وقت المهمة setElementData ( resourceRoot, "Time", num ) function MissonTime ( ) num = num - 1 setElementData ( resourceRoot, "Time", num ) if num <= 0 then if isTimer ( MissonTimer ) then killTimer ( MissonTimer ) end num = 0 end end MissonTimer = setTimer ( MissonTime, 1000, 0 ) addCommandHandler ( "Time", function ( plr ) if getElementData ( resourceRoot, "Time" ) == 0 then outputChatBox ( "لقد بدأت المهمة فعلاً", plr, 255, 0, 0, true ) else outputChatBox ( "بقى على المهمة".. getElementData ( resourceRoot, "Time" ), plr, 0, 255, 0, true ) end end )
  3. createMarker createObject bindKey isElementWithinMarker setTimer moveObject setPedAnimation
  4. حياك الله .. كنت كاتب الكود على السريع ونسيت فاصلة
  5. ماشوف الكود فيه خطأ , فأطرح الكود كامل ..
  6. addEventHandler ( "onPlayerWasted", root, function ( ) setTimer ( spawnPlayer, 3000, 1, source, 2027.8942871094, -1420.7333984375, 16.9921875, 0, 0, 0, 0, nil ) setTimer ( setCameraTarget, 3000, 1, source, source ) setTimer ( fadeCamera, 3000, 1, source, true ) end )
  7. Parameters string command -- addEventHandler ( "onPlayerCommand", root, function ( cmd ) if ( cmd == "login" ) then cancelEvent ( ) outputChatBox ( " disbaled this command", source, 255, 0, 0, false ) elseif ( cmd == "register" ) then cancelEvent ( ) outputChatBox ( " disbaled this command", source, 255, 0, 0, false ) elseif ( cmd == "logout" ) then cancelEvent ( ) outputChatBox ( " disbaled this command", source, 255, 0, 0, false ) end end )
  8. addEventHandler ( "onClientPlayerDamage", localPlayer, function ( _, weapon ) if ( weapon == 41 ) then cancelEvent ( ) end end )
  9. اعتقد تقدر انك تسوي isTimer killTimer وتسوي تايمر جديد , يمكن تنفع يمكن لا ><
  10. كود ثاني : addEventHandler ( "onPlayerCommand", root, function ( cmd ) if cmd == "logout" then cancelEvent ( ) end end )
  11. هذا الكود يوقف الوظيفة مثلا اذا ماتبي تستخدم ذي الطريقة if getElementModel ( element ) == 0 then outputChatBox ( "Go" ) -- راح يمشي الوظيفة else outputChatBox ( "Stop" ) -- راح يوقف الوظيفة end تستخدم هكذا if getElementModel ( element ) ~= 0 then return outputChatBox ( "Stop" ) end
  12. كفوك , حياك الله
  13. جرب اذا ماضبط طف الفري روم , local sbb = { "سيرفر", "حياكم" } function chatbox( text, type) local playername = getPlayerName ( source ) for _, v in ipairs ( sbb ) do if string.find ( text,v ) then cancelEvent ( ) outputChatBox ( playername..": #FFFFFF********** ", getRootElement(), 255, 0, 0, true ) outputServerLog("CHAT: " .. playername .. ": " .. text) return false end end if type == 0 then cancelEvent ( ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then local r, g, b = getPlayerNametagColor(source) cancelEvent ( true ) outputChatBox("admin " .. playername.. ":#ffFFff " .. text, getRootElement(), r, g, b, true ) end end end addEventHandler("onPlayerChat", getRootElement(), chatbox)
  14. اجل يستخدم هذا الايفنت onPlayerDamage or onClientPlayerDamage or onClientPlayerWeaponFire أو يسوي طريقة انه اذا دخل المنطقة يسحب السلاح ويحفظه بالاكاونت داتا وإذا خرج يرجع له السلاح
  15. وليه معقدين السالفة ؟ استخدم هذا : toggleControl or toggleAllControls
  16. استبدل الإيفنت بـ : onPlayerVehicleEnter
  17. GUIEditor = { window = {}, } GUIEditor.window[1] = guiCreateWindow(403, 257, 412, 275, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible ( GUIEditor.window[1], false ) function DrawText() dxDrawRectangle(430, 298, 335, 52, tocolor(255, 0, 0, 130), true) dxDrawText("My Text", 522, 308, 742, 344, tocolor(255, 255, 255, 255), 1, "default", "left", "top", false, false, true, false, false) end local show = false bindKey ( "F1", "down", function ( ) if ( show == false ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) addEventHandler ( "onClientRender", root, DrawText ) show = true else guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) removeEventHandler ( "onClientRender", root, DrawText ) show = false end end )
  18. function drawText() dxDrawRectangle(406, 217, 471, 41, tocolor(255, 0, 0, 160), true) dxDrawText(" My Text", 537, 227, 915, 241, tocolor(0, 0, 0, 255), 1, "default-bold", "left", "top", false, false, true, false, false) end ) addEventHandler("onClientRender",root,drawText) addEventHandler ( "onClientGUIClick", myButton, function ( ) removeEventHandler("onClientRender",root,drawText) end )
×
×
  • Create New...