Jump to content

تصحيح أكواد


Recommended Posts

السلام عليكم

عندي عدة اكواد احتاج إلى تصحيحها ,,

كود اخفاء و اظهار الشات من نفس الزر

addEventHandler ( "onClientGUIClick", GUIEditor.button[3], 
function ( ) 
local t = true  
local f = false 
if t then  
showChat ( false )  
else 
showChat ( true )  
end 
end 
) 

كود اخفاء اظهار سيارة اللاعب من نفس الزر

addEventHandler ( "onClientGUIClick", GUIEditor.button[5], 
function ( player ) 
 local playervehicle = getPlayerOccupiedVehicle ( player ) 
if getElementAlpha(playervehicle) == 255 then 
     if ( playervehicle ) then 
setElementAlpha(playervehicle, 0) 
if getElementAlpha(playervehicle) == 0 then 
setElementAlpha(playervehicle, 255)  
  
                              end 
                       end  
             end 
end  
) 

كود ازالة الجاذبية

addEventHandler ( "onClientGUIClick", root, 
function () 
if source == GUIEditor.button[1] then 
setGravity (0) 
end  
end 
) 

:fadein:

Link to comment
addEventHandler ( "onClientGUIClick", GUIEditor.button[3], 
function ( ) 
if getElementData(localPlayer,'ShowChat') then 
showChat ( false )  
setElementData(localPlayer,'ShowChat',flase) 
else 
showChat ( true )  
setElementData(localPlayer,'ShowChat',true) 
end 
end 
) 

كود اخفاء اظهار سيارة اللاعب من نفس الزر

addEventHandler ( "onClientGUIClick", GUIEditor.button[5], 
function ( ) 
 local playervehicle = getPlayerOccupiedVehicle (localPlayer) 
  if ( playervehicle ) then 
if getElementAlpha(playervehicle) == 255 then 
setElementAlpha(playervehicle, 0) 
if getElementAlpha(playervehicle) == 0 then 
setElementAlpha(playervehicle, 255)  
  
                              end 
                       end  
             end 
end  
) 

كود ازالة الجاذبية

addEventHandler ( "onClientGUIClick", root, 
function () 
if source == GUIEditor.button[1] then 
setGravity (0) 
end  
end 
) 

:fadein:

Link to comment

أو .. :

local isChatVisible = nil 
  
addEventHandler('onClientGUIClick',GUIEditor.button[3], 
    function (  ) 
        if not isChatVisible then 
            showChat ( false ) 
        else 
            showChat ( true ) 
        end 
    isChatVisible = not isChatVisible 
end,false 
) 
  

addEventHandler('onClientGUIClick',GUIEditor.button[5], 
    function (  ) 
        local aVehicle = getPlayerOccupiedVehicle ( localPlayer ) 
        if aVehicle then 
            if getElementAlpha ( aVehicle ) == 255 then 
                setElementAlpha ( aVehicle,0 ) 
            else 
            setElementAlpha ( aVehicle,255 ) 
        end 
    end 
end,false 
                 
) 

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