Jump to content

دمج سكريبت السجن مع زر


Recommended Posts

أريد أن أغير كيفية ظهور لوحة السجن ، يعني ليس عند كتابة الكومند فالشات ، أريد أن تظهر لي عند الضغط على زر في لوحة أخرى

https://community.multitheftauto.com/index.php?p= ... ls&id=3251

function guiToggleVisible ( )         
        if ( guiGetVisible ( b1 ) == true ) then            
                guiSetVisible ( b1, false ) 
                showCursor(false)                
        else               
                guiSetVisible ( b1, true ) 
                    showCursor(true) 
        end 
end 
  
b1 = guiCreateButton ( 0.4, 0.4, 0.2, 0.1, "Clique me", true ) 
        guiSetVisible ( b1, false ) 
        bindKey ( "F1", "down", guiToggleVisible )  

هذا مثال عن الزر ، عند الضغط الزر ، أريد أن تظهر لي لوحة السجن ، شكرا

Link to comment

امسح الكومند وضع هذا

  
  
bindKey ( "F1" , "down" , function() 
  
if ( guiGetVisible ( اسم النافذه ) == true ) then 
 guiSetVisible ( اسم النافذه ,false ) 
 showCursor (false ) 
 guiSetInputEnabled(false) 
  
 elseif ( guiGetVisible ( اسم النافذه ) == false ) then 
 guiSetVisible ( اسم النافذه ,true ) 
 showCursor (false ) 
 guiSetInputEnabled(true) 
  
 end 
 end 
 ) 

Edited by Guest
Link to comment

أعتقد أنك لم تفهمني

المشكل إنو في سكريبت السجن

commandhandler is in server side , and if i want to merge it with the button , i must move it to client side

جربة عدة طرق لكن لم أجد الحل

عند الضغط على الزر يجب أن تظهر لوحة السجن

شكرا على المساعدة

Link to comment

-- Server Side

bindKey("F2","up", 
    function() 
        triggerClientEvent(source,"open",source) 
    end 
) 

-- Client Side

addEvent("open",true) 
addEventHandler("open",root, 
    function() 
        if guiGetVisible( theWindow ) == false then 
            guiSetVisible( theWindow , true ) 
            showCursor( true ) 
        else 
            guiSetVisible( theWindow , false ) 
            showCursor( false ) 
        end 
    end 
) 

Link to comment
-- Server Side
bindKey("F2","up", 
    function() 
        triggerClientEvent(source,"open",source) 
    end 
) 

-- Client Side

addEvent("open",true) 
addEventHandler("open",root, 
    function() 
        if guiGetVisible( theWindow ) == false then 
            guiSetVisible( theWindow , true ) 
            showCursor( true ) 
        else 
            guiSetVisible( theWindow , false ) 
            showCursor( false ) 
        end 
    end 
) 

شكرا يا أخ ، جزاك الله خيرا ، لكن أنت أيضا لم تفهمني ، إممم يمكن إذا أوضح لكم بالإنجليزي سوف تفهمون طلبي

I have the jail script ( this one https://community.multitheftauto.com/index.php?p= ... ls&id=3251 ) i want to modife it , i want that jail panel will not be called when you type (/jail ) , i want to merge it with a button ( onClientGUIClick) , so when i clique on the button , the jail panel will be shown :)

المعذرة لكن عند استعمالي اللغة الانجليزية أعتقد انكم ستفهمون ، شكرا مرة أخرى

Link to comment
addEventHandler("onClientGUIClick",root, 
    function() 
        if source == theButton then 
            guiSetVisible( theWindow , true) 
            showCursor( true ) 
        end 
    end 
) 

سوف اشرح لك بالنجليزي مرة أخرى

look its simple , the jail panel made by Al3grab (https://community.multitheftauto.com/index.php?p= ... ls&id=3251) work when you use /jail , i want to change this , i want to add Button called jail , and when you press this button , the jail panel will be appeared .

يرحم والديك يا أخي على المساعدة

Link to comment
i want to add Button called jail
theButton = guiCreateButton(0.5, 0.5, 0.2, 0.1, "jail", true) 

===========================================================================

and when you press this button , the jail panel will be appeared .
addEventHandler("onClientGUIClick",root, 
    function() 
        if source == theButton then 
            executeCommandHandler("jail") 
        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...