Jump to content

مشكلة بسيطة


M7mD-911

Recommended Posts

السلآم عليكم ورحمة الله وبركاتة

بننقز للموضوع سريع

انا مسوي

--Client 
if source == button then 
setElementData(localPlayer, "Sa", true) 
end 
  
--Server  
function Mta( )          
  if getElementData(source, "Sa") then 
 -- Code 
  end     
end 
  

وسويت زر يحذف الالمنت

  
-- Client 
if source == Button1 then 
  local Sa = getElementData ( localPlayer, "Sa" ) 
    destroyElement ( Sa ) 
end 
  

انا جربت كذا .. بس ما زبط فيه حل ثاني ؟

Link to comment
-- Client Side # 
if ( source == Button1 ) and ( getElementData ( localPlayer, "Sa" ) ) then 
    triggerServerEvent ( "RemoveData", localPlayer ) 
end 

-- Server Side # 
addEvent ( "RemoveData", true ) 
addEventHandler ( "RemoveData", root, 
    function ( ) 
        removeElementData ( client, "Sa" ) 
    end 
) 

Link to comment

جآري التجربة..

مشكور

طيب اذا بغيت الغي المنت ثلاثة او ثنين

...

اسوي كذآ ؟

if ( source == Button1 ) and ( getElementData ( localPlayer, "Sa" ) ) and ( getElementData ( localPlayer, "Saa" ) ) then

triggerServerEvent ( "RemoveData", localPlayer )

end

Link to comment
-- Client Side # 
if ( source == Button1 ) and ( getElementData ( localPlayer, "Sa" ) ) and ( getElementData ( localPlayer, "Saa" ) ) then 
    triggerServerEvent ( "RemoveData", localPlayer ) 
end 

-- Server Side # 
addEvent ( "RemoveData", true ) 
addEventHandler ( "RemoveData", root, 
    function ( ) 
        removeElementData ( client, "Sa" ) 
        removeElementData ( client, "Saa" ) 
    end 
) 

Link to comment
-- Client Side # 
if ( source == Button1 ) and ( getElementData ( localPlayer, "Sa" ) ) and ( getElementData ( localPlayer, "Saa" ) ) then 
    triggerServerEvent ( "RemoveData", localPlayer ) 
end 

-- Server Side # 
addEvent ( "RemoveData", true ) 
addEventHandler ( "RemoveData", root, 
    function ( ) 
        removeElementData ( client, "Sa" ) 
        removeElementData ( client, "Saa" ) 
    end 
) 

الكود ما ضبط

ابي افهم وش client

Link to comment
-- Client Side # 
if ( source == Button1 ) and ( getElementData ( localPlayer, "Sa" ) ) and ( getElementData ( localPlayer, "Saa" ) ) then 
    triggerServerEvent ( "RemoveData", localPlayer ) 
end 

-- Server Side # 
addEvent ( "RemoveData", true ) 
addEventHandler ( "RemoveData", root, 
    function ( ) 
        removeElementData ( client, "Sa" ) 
        removeElementData ( client, "Saa" ) 
    end 
) 

الكود ما ضبط

ابي افهم وش client

# افتح عليها وبتفهمها

Link to comment

لا الكود بيضبط % 100

client :

The client class represents any client that has connected to the server. This can be a player or the console.

All client functions can operate on both player and server console elements.

بإختصار هي تحطها وقت ترسل تريقر لوكل من الكلنت,

triggerServerEvent ( "RemoveData", localPlayer )

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