jafar
Members-
Posts
1,434 -
Joined
-
Last visited
Everything posted by jafar
-
وش يعني num ??? متغير انت تسويه , ترمز اليه بأي اسم مثلاً : TheKing وفايدته في ذا الكود انه هو الي يحدد وقت المهمة ^^
-
الباقي عن الوقت , استخدم متغير وتايمر والالمنت داتا , مثلاً : -- 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 )
-
createMarker createObject bindKey isElementWithinMarker setTimer moveObject setPedAnimation
-
الله يسلمك
-
شغال 100 %
-
ماشوف الكود فيه خطأ , فأطرح الكود كامل ..
-
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 )
-
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 )
-
addEventHandler ( "onClientPlayerDamage", localPlayer, function ( _, weapon ) if ( weapon == 41 ) then cancelEvent ( ) end end )
-
اعتقد تقدر انك تسوي isTimer killTimer وتسوي تايمر جديد , يمكن تنفع يمكن لا ><
-
كود ثاني : addEventHandler ( "onPlayerCommand", root, function ( cmd ) if cmd == "logout" then cancelEvent ( ) end end )
-
هذا الكود يوقف الوظيفة مثلا اذا ماتبي تستخدم ذي الطريقة if getElementModel ( element ) == 0 then outputChatBox ( "Go" ) -- راح يمشي الوظيفة else outputChatBox ( "Stop" ) -- راح يوقف الوظيفة end تستخدم هكذا if getElementModel ( element ) ~= 0 then return outputChatBox ( "Stop" ) end
-
جرب اذا ماضبط طف الفري روم , 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)
-
اجل يستخدم هذا الايفنت onPlayerDamage or onClientPlayerDamage or onClientPlayerWeaponFire أو يسوي طريقة انه اذا دخل المنطقة يسحب السلاح ويحفظه بالاكاونت داتا وإذا خرج يرجع له السلاح
-
وليه معقدين السالفة ؟ استخدم هذا : toggleControl or toggleAllControls
-
استبدل الإيفنت بـ : onPlayerVehicleEnter
-
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 )
-
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 )
