Jump to content

< لوحة تفتح ب رتبة


Recommended Posts

---ClientSide 
function toggleGUI() 
    if guiGetVisible(GUIEditor_Window[1]) == true then 
        guiSetVisible(GUIEditor_Window[1],false) 
        showCursor(false) 
    else 
        guiSetVisible(GUIEditor_Window[1],true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 
  
-------ServerSide 
  
addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"F1","down",showGUI) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
    bindKey(player,"F1","down",showGUI) 
    end 
end) 
  
function showGUI(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then 
        triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
    else 
        outputChatBox("You must be an admin",thePlayer,255,0,0) 
    end 
end 
Link to comment
ماكس انا في سيرفر مجاني و اف1 شغال لما اطغط اف1 تفتح ويكتب في شات

you must admin

واف1 يفتح

اكيد راح يفتح لازم تعدل عليه اذا القيم مود

play

انا احسبك نافذة ثانية او قيم مود ثاني

+ استبدل اسم اللوحة في الكود

لاسم لوحتك ...

Link to comment

انا سويت كذا

كلنت

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

سيرفر

addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"F4","down",showGUI) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
    bindKey(player,"F4","down",showGUI) 
    end 
end) 
  
function showGUI(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then 
        triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
    else 
        outputChatBox("You must be an admin",thePlayer,255,0,0) 
    end 
end 

وجربت افتح لوحة من اف4 وتفتح

وذا الوحة

  
wnd = guiCreateWindow(358, 338, 299, 99, "Out/on/ jobs", false) 
guiWindowSetSizable(wnd, false) 
  
button1 = guiCreateButton(10, 23, 118, 66, "Start Shift", false, wnd) 
guiSetProperty(button1, "NormalTextColour", "FF10F40A") 
button2 = guiCreateButton(171, 23, 118, 66, "out Shift", false, wnd) 
guiSetProperty(button2, "NormalTextColour", "FF10F40A") 

Link to comment

الخطا في السيرفر يا احمد

addEventHandler("onPlayerJoin",root,

function ()

bindKey(source,"F4","down",showGUI)

end)

addEventHandler("onResourceStart",resourceRoot,

function ()

for index, player in ipairs(getElementsByType("player")) do

bindKey(player,"F4","down",showGUI)

end

end)

function showGUI(thePlayer)

if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Console")) then

triggerClientEvent(thePlayer,"toggleGUI",thePlayer)

else

outputChatBox("You must be an admin",thePlayer,255,0,0)

end

end

انت لو تبي الرتبة ادمن يبقا لازم تحط اسمك في الاسل في قروب ادمن

لو تبيه كونسول حط اسمك في قروب كونسول

^_^

Link to comment

[quote name=[#]~~,xMI[N]A=xD_)]الخطا في السيرفر يا احمد

addEventHandler("onPlayerJoin",root,

function ()

bindKey(source,"F4","down",showGUI)

end)

addEventHandler("onResourceStart",resourceRoot,

function ()

for index, player in ipairs(getElementsByType("player")) do

bindKey(player,"F4","down",showGUI)

end

end)

function showGUI(thePlayer)

if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Console")) then

triggerClientEvent(thePlayer,"toggleGUI",thePlayer)

else

outputChatBox("You must be an admin",thePlayer,255,0,0)

end

end

انت لو تبي الرتبة ادمن يبقا لازم تحط اسمك في الاسل في قروب ادمن

لو تبيه كونسول حط اسمك في قروب كونسول

^_^

مافيه خطأ بالكود

بس هو يبي يخلي نافذة

F1 --- قيم مود بلاي تفتح للادمن

وهي اصلا تفتح للجميع

ولازم يعدل على القيم مود نفسه . .

Link to comment

جرب هذي الطريقة مختصرة اكثر .. :

addEventHandler( "onResourceStart", resourceRoot, function (   ) 
  for _, players in ipairs( getElementsByType "player" ) do 
    if ( isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( players ) ),aclGetGroup( "Admin" ) ) ) then 
        bindKey( players, "F4", "down", triggerToClient ) 
    end 
end ) 
  
addEventHandler( "onPlayerLogin", root, function ( _,acc ) 
   if ( isObjectInACLGroup( "user."..getAccountName( acc ),aclGetGroup( "Admin" ) ) ) then 
       bindKey( source, "F4", "down", triggerToClient ) 
    end 
end )     
   
  
triggerToClient = function ( player ) 
   triggerClientEvent( player, "toggleGUI", player ) 
end 
Link to comment
جرب هذي الطريقة مختصرة اكثر .. :

addEventHandler( "onResourceStart", resourceRoot, function (   ) 
  for _, players in ipairs( getElementsByType "player" ) do 
    if ( isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( players ) ),aclGetGroup( "Admin" ) ) ) then 
        bindKey( players, "F4", "down", triggerToClient ) 
    end 
end ) 
  
addEventHandler( "onPlayerLogin", root, function ( _,acc ) 
   if ( isObjectInACLGroup( "user."..getAccountName( acc ),aclGetGroup( "Admin" ) ) ) then 
       bindKey( source, "F4", "down", triggerToClient ) 
    end 
end )     
   
  
triggerToClient = function ( player ) 
   triggerClientEvent( player, "toggleGUI", player ) 
end 

أفرض إن الأدمن سحب رتبة اللاعب وهو موجود , تتوقع وش يصير ؟ :mrgreen:

Link to comment

مثال الوحة ذي

wnd = guiCreateWindow(358, 338, 299, 99, "Out/on/ jobs", false) 
guiWindowSetSizable(wnd, false) 
  
button1 = guiCreateButton(10, 23, 118, 66, "Start Shift", false, wnd) 
guiSetProperty(button1, "NormalTextColour", "FF10F40A") 
button2 = guiCreateButton(171, 23, 118, 66, "out Shift", false, wnd) 
guiSetProperty(button2, "NormalTextColour", "FF10F40A") 

Link to comment

--- سيرفر

addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"F1","down",showGUI) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
    bindKey(player,"F1","down",showGUI) 
    end 
end) 
  
function showGUI(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Admin")) then 
        triggerClientEvent(thePlayer,"toggleGUI",thePlayer) 
    else 
        outputChatBox("You must be an admin",thePlayer,255,0,0) 
    end 
end 

-- كلينت

wnd = guiCreateWindow(358, 338, 299, 99, "Out/on/ jobs", false) 
guiWindowSetSizable(wnd, false) 
guiSetVisible ( wnd, false ) 
button1 = guiCreateButton(10, 23, 118, 66, "Start Shift", false, wnd) 
guiSetProperty(button1, "NormalTextColour", "FF10F40A") 
button2 = guiCreateButton(171, 23, 118, 66, "out Shift", false, wnd) 
guiSetProperty(button2, "NormalTextColour", "FF10F40A") 
  
function toggleGUI() 
    if guiGetVisible(wnd) == true then 
        guiSetVisible(wnd,false) 
        showCursor(false) 
    else 
        guiSetVisible(wnd,true) 
        showCursor(true) 
    end 
end 
addEvent("toggleGUI",true) 
addEventHandler("toggleGUI",root,toggleGUI) 
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...