Jump to content

Recommended Posts

ahla ya jma3a

il script hadha ma7abch ya5dem ama la79i9a 5dhit min script a5ar

SERVER

function isPlayeriv ( thePlayer ) 
    if ( isElement( thePlayer ) ) then 
        if ( getElementData(thePlayer, "isPlayeriv" ) ) then 
            return true 
        else 
            return false 
        end 
    else 
        return false 
    end 
end 
  
function isPlayertbogt ( thePlayer ) 
    if ( isElement( thePlayer ) ) then 
        if ( getElementData(thePlayer, "isPlayertbogt" ) ) then 
            return true 
        else 
            return false 
        end 
    else 
        return false 
    end 
end 
  
function isPlayertlad ( thePlayer ) 
    if ( isElement( thePlayer ) ) then 
        if ( getElementData(thePlayer, "isPlayertlad" ) ) then 
            return true 
        else 
            return false 
        end 
    else 
        return false 
    end 
end 

Link to comment
hedhom exports, zid'hom fel meta, wa9teli beh te5dm behom ekteb:
exports.resourceName:functionName(player) 

aka s7i7a ?

       function="isPlayeriv" type="server" />       function="isPlayeriv" type="client" />        function="isPlayereflc" type="server" />       function="isPlayereflc" type="client" />        function="isPlayertlad" type="server" />       function="isPlayertlad" type="client" />

ena n7ab najam nasta3mlom haka

setElementData( source, "isPlayeriv", false ) 
setElementData( source, "isPlayertbogt", false ) 
setElementData( source, "isPlayertlad", false ) 
  
setElementData( source, "isPlayeriv", true ) 
setElementData( source, "isPlayertbogt", true ) 
setElementData( source, "isPlayertlad", true ) 

Link to comment

kolhom server side.

-- Meta: 
function="isPlayeriv" type="server" /> 
function="isPlayereflc" type="server" /> 
function="isPlayertlad" type="server" /> 
-- wa9teli testa3lha: 
if (exports.resourceName:isPlayeriv(source)) then 
setElementData( source, "isPlayeriv", true) 
else 
setElementData( source, "isPlayeriv", false) 
end 
if (exports.resourceName:isPlayertbogt(source)) then 
setElementData( source, "isPlayertbogt", true) 
else 
setElementData( source, "isPlayertbogt", false ) 
end 
if (exports.resourceName:isPlayertlad(source)) then 
setElementData( source, "isPlayertlad", true) 
else 
setElementData( source, "isPlayertlad", false ) 
end 
  

Link to comment
ye5dmou zeda client side, just badl file type fel meta el 'client' wel exports type el "client"

exmple hadhi kifa na3mlha ?

addEventHandler( "onClientMouseEnter", root,  
    function(thePlayer) 
        if ( getElementType ( source ) == "gui-button" ) then 
            --ki yabda Playeriv 
            guiSetProperty( source, "HoverTextColour", "FE9A0000" ) 
            --ki yabda isPlayertlad 
            guiSetProperty( source, "HoverTextColour", "CD3AD100" ) 
            --ki yabda isPlayertbogt  
            guiSetProperty( source, "HoverTextColour", "80000000" ) 
        end 
                     end 
    end 
) 
  
addEventHandler( "onClientMouseLeave", root,  
    function() 
        if ( getElementType ( source ) == "gui-button" ) then 
            guiSetProperty( source, "HoverTextColour", "FFFFFFFF" ) 
        end 
    end 
) 

Link to comment
addEventHandler( "onClientMouseEnter", root, 
function(thePlayer) 
if ( getElementType ( source ) == "gui-button" ) then 
if (exports.resourceName:isPlayeriv(thePlayer)) then 
guiSetProperty( source, "HoverTextColour", "FE9A0000" ) 
end 
if (exports.resourceName:isPlayertlad(thePlayer)) then 
guiSetProperty( source, "HoverTextColour", "CD3AD100" ) 
end 
if (exports.resourceName:isPlayertbogt(thePlayer)) then 
guiSetProperty( source, "HoverTextColour", "80000000" ) 
end 
end 
end 
) 
  
addEventHandler( "onClientMouseLeave", root, 
function() 
if ( getElementType ( source ) == "gui-button" ) then 
guiSetProperty( source, "HoverTextColour", "FFFFFFFF" ) 
end 
end 
) 

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