Jump to content

مشكلة في كود


Recommended Posts

شباب انا عندي كود لما ادخل ماركر تطلع لوحة

اللوحة فيها اديت لرقم سري

وفيها زر موافق

لو ادخلت 12345 في الايديت وضغط موافق

يسوي تحريك للاوبجيكت

بس الكود مو راضي يشتغل

والماركر والاوبجيكت ما يجون ليش؟؟؟

سيرفر

marker = createMarker ( 2462.1999511719, -1656.4000244141, 12.300000190735, "cylinder", 1, 0, 255, 0, 255 ) 
Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function markerHit(hitElement) 
triggerClientEvent ("gui", getRootElement(), hitElement) 
end 
addEventHandler( "onMarkerHit", marker, markerHit ) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 
  

كلنت

wnd = guiCreateWindow(360, 306, 267, 136, "مقر", false) 
  
  
guiCreateLabel(50, 28, 225, 49, "ادخل كلمة المرور لفتح البوابة:", false, wnd) 
  
text = guiCreateEdit(28, 61, 221, 37, "", false, wnd) 
  
guiEditSetMasked(text, true) 
  
button = guiCreateButton(100, 108, 64, 18, "موافق", false, wnd) 
  
  
function wnd1 () 
    guiSetVisible(wnd,true) 
    showCursor(true) 
    guiSetText(text,"") 
end 
addEvent("gui", true ) 
addEventHandler("gui", getRootElement(), wnd1) 
  
addEventHandler ("onClientGUIClick", button, 
function () 
    if guiGetText(text, "12345") then 
        guiSetVisible(wnd,false) 
        showCursor(false) 
        triggerServerEvent ("mvmarker", localPlayer) 
        outputChatBox ("رقم سري صحيح",0,255,0) 
    else 
        guiSetVisible(wnd,false) 
        showCursor(false) 
        outputChatBox ("رقم سري خاطئ",255,0,0) 
        end 
end 
) 
  
addEventHandler("onClientResourceStart",root, 
function() 
    guiSetVisible(wnd,false) 
end 
) 
  

انا اعتقد ان المشكلة من ملف سيرفر

Link to comment

    wnd = guiCreateWindow(360, 306, 267, 136, "مقر", false) 
      
      
    guiCreateLabel(50, 28, 225, 49, "ادخل كلمة المرور لفتح البوابة:", false, wnd) 
      
    text = guiCreateEdit(28, 61, 221, 37, "", false, wnd) 
      
    guiEditSetMasked(text, true) 
      
    button = guiCreateButton(100, 108, 64, 18, "موافق", false, wnd) 
      
      
    function wnd1 () 
        guiSetVisible(wnd,true) 
        showCursor(true) 
        guiSetText(text,"") 
    end 
    addEvent("gui", true ) 
    addEventHandler("gui", getRootElement(), wnd1) 
      
    addEventHandler ("onClientGUIClick", button, 
    function () 
        if guiGetText(text) == "12345" then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
            triggerServerEvent ("mvmarker", localPlayer) 
            outputChatBox ("رقم سري صحيح",0,255,0) 
        else 
            guiSetVisible(wnd,false) 
            showCursor(false) 
            outputChatBox ("رقم سري خاطئ",255,0,0) 
            end 
    end 
    ) 
      
    addEventHandler("onClientResourceStart",root, 
    function() 
        guiSetVisible(wnd,false) 
    end 
    ) 
      
Link to comment

بس ابي اذا انفك الباب ينصك بعد ثانيتين

وين اضيف:

setTimer(moveop,2000,1) 

وين اضيفه في ملف سيرفر

Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 
  

وعلى فكرة حطيت كودات الماركر في كلنت واشتغل %100

Link to comment
سوي تايمر يرجع الاوبجكت,
setTimer 
moveObject 

بصراحة مافهمت وين احط مكانه التايمر

بس كذا صح؟

Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
th = moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 
setTimer(th,2000,1) 

Link to comment

داخل الوظيفه تخليه,

Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
    setTimer(moveObject,2000,1,Object,1000,2500.8999023438,-1662.0999755859,12.300000190735) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 
Link to comment

    marker = createMarker ( 2462.2, -1656.4, 12.3, "cylinder", 1.3, 0, 255, 0, 255 ) 
    Object = createObject ( 2951, 2462.9, -1656.7, 12.3, 0, 0, 88.75) 
      
    function markerHit(hitElement) 
    triggerClientEvent ("gui", getRootElement(), hitElement) 
    end 
    addEventHandler( "onMarkerHit", marker, markerHit ) 
      
    function moveop() 
    moveObject (Object, 1000, 2462.9, -1662.1, 12.3) 
    setTimer (moveObject, 2500, 1, Object, 1000, 2462.9, -1656.7, 12.3) 
    end 
    addEvent("mvmarker", true ) 
    addEventHandler("mvmarker", root, moveop) 
      
Link to comment

^ ليه الماركر سيرفر بما انه يجي كلينت اصلا -__-" + تحتاج تتحقق من اللاعب

max-mohammed @

تأكد انك بدلت الاحداثيات الجديده

local Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
    setTimer(moveObject,2000,1,Object,1000,x,y,z) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 

x,y,z = الاحداثيات الي تبي الاوبجكت يروح لها

Link to comment
^ ليه الماركر سيرفر بما انه يجي كلينت اصلا -__-" + تحتاج تتحقق من اللاعب

max-mohammed @

تأكد انك بدلت الاحداثيات الجديده

local Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
    setTimer(moveObject,2000,1,Object,1000,x,y,z) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 

x,y,z = الاحداثيات الي تبي الاوبجكت يروح لها

شكراااااااااااااااااااااااااااااااااااااااااااااااااااااااااااا

الكود اشتغل وزبط %100 والله كفوو

Link to comment

اول شي الكود اصلا كان عنده هذا

انا ما ضفت عليه شي ولا شي

بس عدلت على حسب طلبه -,-

    marker = createMarker ( 2462.2, -1656.4, 12.3, "cylinder", 1.3, 0, 255, 0, 255 ) 
    Object = createObject ( 2951, 2462.9, -1656.7, 12.3, 0, 0, 88.75) 
      
    function markerHit(hitElement) 
    triggerClientEvent ("gui", getRootElement(), hitElement) 
    end 
    addEventHandler( "onMarkerHit", marker, markerHit ) 
      
    function moveop() 
    moveObject (Object, 1000, 2462.9, -1662.1, 12.3) 
    setTimer (moveObject, 2500, 1, Object, 1000, 2462.9, -1656.7, 12.3) 
    end 
    addEvent("mvmarker", true ) 
    addEventHandler("mvmarker", root, moveop) 
      

يعني اذا يبي الاعب بس كان سوا تحقق

ثاني شي

وش الي ليه شايفني حاط الماركر اصلا ؟

Link to comment

انت تقول ,

طيب انا ما اشوف انك تحققت من الاعبب -,-

وانا رديت ,

ليه تشوفني حطيت ماركر اصلا؟

وهذا كودي ,

^ ليه الماركر سيرفر بما انه يجي كلينت اصلا -__-" + تحتاج تتحقق من اللاعب

max-mohammed @

تأكد انك بدلت الاحداثيات الجديده

local Object = createObject ( 2951, 2462.8999023438, -1656.6999511719, 12.300000190735, 0, 0, 88.75) 
  
function moveop() 
moveObject (Object, 1000, 2462.8999023438, -1662.0999755859, 12.300000190735) 
    setTimer(moveObject,2000,1,Object,1000,x,y,z) 
end 
addEvent("mvmarker", true ) 
addEventHandler("mvmarker", root, moveop) 

x,y,z = الاحداثيات الي تبي الاوبجكت يروح لها

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...