Jump to content

مشكلة في التريقر


Recommended Posts

سلام عليكم

عندي اديت بوكس

GEDIT = guiCreateEdit(489, 359, 48, 29, "", false)

وعندي ليبل

anr = guiCreateLabel(801, 329, 34, 25, "", false)

ابيه اذا ضغط على زر

يطلع الكلام اللي مكتوب في الاديت بوكس

في الليبل

#

هذي محاولتي

" مشكلتها"

اذا ضغط اللاعب يظهر عنده بس مايظهر عند كل اللاعبين

كلنت !
 

        addEventHandler ( "onClientGUIClick", root,
function (  )
if source == GUIEditor.button[6] then
triggerServerEvent ( "2", localPlayer )
end
end)

        addEvent('22',true)
addEventHandler('22',root,
function ()
      local Get = guiGetText(GEDIT)
        guiSetText(anr,Get)

end) 

سيرفر

    addEvent( "2",true )
addEventHandler( "2",root,
    function ()
triggerClientEvent( source,"22",source )
        end
)

واستخدمت الداتا ومانفع

    setElementData(localPlayer, "show", true)
            if ( getElementData ( localPlayer, "show" ) == true ) then

 

Edited by FOX_script
data
Link to comment

 جرب :

 

-- #Client Side :

addEventHandler ( 'onClientGUIClick', root, function (  )
    if ( source == GUIEditor.button[6] ) then
        triggerServerEvent ( '2', root, guiGetText ( GEDIT ) )
    end
end )

addEvent ( '22', true )
addEventHandler ( '22', root, function ( Request )
    guiSetText ( anr, Request )
end    ) 

-- #Server Side :

addEvent ( '2', true )
addEventHandler ( '2',root, function ( texta )
    triggerClientEvent ( root, '22', root, texta )
end )

 

 

Link to comment
addEventHandler ( "onClientGUIClick", root,
function ( )
if source == GUIEditor.button[6] then
triggerServerEvent ( "2", localPlayer ) -- كذا بيرسل التريقر للاعب الي ضغط الزر وهنا انت مارسلت الكلام المكتوب فلازم ترسله
end
end)



addEvent('22',true)
addEventHandler('22',root,
function ()
local Get = guiGetText(GEDIT) -- هنا الغلطة انك جبت الكلام من عند الاعب نفسه وحطيته تحت
guiSetText(anr,Get)
end)

    addEvent( "2",true )
addEventHandler( "2",root,
    function ()
triggerClientEvent( source,"22",source ) -- هنا انت ارسل التريقر للاعب الي ضغط الزر فقط لازم root  + لازم ترسل الكلام الي استقبلته من الكلنت
        end
)

 

Link to comment

 

المشكلة هنا

if getfromadmin == getfromplayer then

الشرط مب شغال

وابيه يظهر لكل الناس

وش الحل ؟

        edit1 = guiCreateEdit(558, 101, 116, 37, "1", false)
        edit2 = guiCreateEdit(348, 82, 143, 39, "2", false)
        edit3 = guiCreateEdit(322, 139, 174, 60, "3", false)
        done = guiCreateButton(558, 162, 118, 37, "Done", false)

   local getfromplayer = guiGetText(edit2)
  local getfromadmin = guiGetText(edit3)
 
            addEventHandler ( 'onClientGUIClick', root, function (  )
    if ( source == done ) then
       LVL10s()
    end
end )
 
function LVL10s()
if getfromadmin == getfromplayer then
LVL10sss()
else
LVL10sssss()
end
end

function LVL10sss()
local getlvl = guiGetText(edit1)
if getlvl == "1" then
setPlayerMoney ( 999 )
end

end

function LVL10sssss()
local getlvl2 = guiGetText(edit1)
if getlvl2 == "1" then
setPlayerMoney ( 200 )
end

end

 

Link to comment

عندي زر

اذا ضغط عليه 

يستدعي الفنكشن

LVL10s()

 

وفي الفنكشن

فيه

شرط او تحقق

معرف

   local getfromplayer = guiGetText(edit2)
  local getfromadmin = guiGetText(edit3)
if getfromadmin == getfromplayer then

 

المشكلة الشرط ذا مب راضي يشتغل

انا حاطه اذا تم استدعاء

LVL10s()

وان

if getfromadmin == getfromplayer then

يستدعي

LVL10sss()

 

وكذا

لو فهمت الكود فوق بتفهم الوضع

Link to comment

شوف

في زر

اوك

ابي اذا اي لاعب ضغط عليه

يسوي تحقق

او شرط

اللي هو if

اذا الكلام اللي في الديت الاول = الكلام في الديت الثاني

 

اذا تحقق الشرط

يطلب فنكشن معين

واذا ما تحقق

يطلب فنكشن ثاني

Link to comment

التعريفين يلي بسطر 6 و 7 حطهم بالحدث يوم الاعب يضغط الزر يعني كذه 

addEventHandler ( 'onClientGUIClick', root, function (  )
local getfromplayer = guiGetText(edit2)
local getfromadmin = guiGetText(edit3)
if ( source == done ) then
LVL10s()
end
end
)
 

 

Link to comment
-- # Client Side :

        edit1 = guiCreateEdit(558, 101, 116, 37, "1", false)
        edit2 = guiCreateEdit(348, 82, 143, 39, "2", false)
        edit3 = guiCreateEdit(322, 139, 174, 60, "3", false)
        done = guiCreateButton(558, 162, 118, 37, "Done", false)
 
addEventHandler ( 'onClientGUIClick', root, function (  )
    if ( source == done ) then
       LVL10s (    )
    end
end )
 
function LVL10s (    )
    if ( guiGetText ( edit2 ) == guiGetText ( edit3 ) ) then
        LVL10sss (    )
    else
        LVL10sssss (    )
    end
end

function LVL10sss (    )
    if ( guiGetText ( edit1 ) == "1" ) then
        triggerServerEvent ( 'RequestMoney', localPlayer, 999 )
    end
end

function LVL10sssss()
    if ( guiGetText ( edit1 ) == "1" ) then
        triggerServerEvent ( 'RequestMoney', localPlayer, 200 )
    end
end

-- # Server Side :

addEvent ( 'RequestMoney', true )

addEventHandler ( 'RequestMoney', root, function ( mmm )
    setPlayerMoney ( source, mmm )
end )

 

Link to comment

 

7 hours ago, Default said:

ارسل ترايقر من السيرفر للكلينت على كل اللاعبين وقفل الزر

سويت

وما اشتغل !

كلنت !
 

function LVL1T (    )
    if ( guiGetText ( lvel ) == "1" ) then
    triggerServerEvent ( 'TRUE11', localPlayer )
else
    cancelEvent ()
    end
end

 addEvent ( 'TRUE1', true )
function LVL1TT(    )
        setElementData(root, "lvls11", false)
setElementData(root, "lvls22", true)
guiSetVisible (LVL1, true)
guiSetAlpha ( LVL1, 1 )
guiLabelSetColor(LVL1, 0, 255, 0)
outputChatBox( "#0099CC[ ACEEPTED] ] : #ff0000" , 255 , 0 , 0 , true )
triggerServerEvent ( "lvlv", root )
setElementData(root, "lvls11ss", true)
end
addEventHandler ( 'TRUE1', root, LVL1TT )

سيرفر

 هنا ماحطيت كل اللاعبين

انا حطيت الي في تيم محدد !


local lvlchhhh22 = {"Team1", "Team2", "Team3"}
addEvent ( 'TRUE11', true )

addEventHandler ( 'TRUE11', root, function (  )
    for i=1, #lvlchhhh22 do
        local team88 = getTeamFromName(lvlchhhh22[i])
        if team88 then
    for _,v in ipairs ( getPlayersInTeam ( getTeamFromName(lvlchhhh22[i]) ) ) do  
    triggerClientEvent ( root, 'TRUE1', root )
    end
    end
    end
end )

 

Link to comment

شايف

        setElementData(root, "lvls11", false)
setElementData(root, "lvls22", true)
guiSetVisible (LVL1, true)
guiSetAlpha ( LVL1, 1 )
guiLabelSetColor(LVL1, 0, 255, 0)
outputChatBox( "#0099CC[ ACEEPTED] ] : #ff0000" , 255 , 0 , 0 , true )
triggerServerEvent ( "lvlv", root )
setElementData(root, "lvls11ss", true)

ابيهم يتسوووا

اذا الكلام اللي في الاديت الاول يساوي الكلام اللي في الاديت الثاني

لتيمات معينة

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...