Jump to content

|BindKey Amdin|


Recommended Posts

سوي الكود و تحقق اذا اللاعب ادمن بس :/

key = "K" -- F1 بدل الحرف الي بين العلامتين للزر الي تبيه مثلا  
bindKey ( هنا تحدد اللاعب,  
key, "down",  
function() 
local account=getAccountName( getPlayerAccount( هنا اللاعب الي ضغط الزر ) 
if isObjectInACLGroup("user.".. account, aclGetGroup("Console") ) then 
-- your code 
end 
end    ) 

Edited by Guest
Link to comment
سوي الكود و تحقق اذا اللاعب ادمن بس :/
key = "K" -- F1 بدل الحرف الي بين العلامتين للزر الي تبيه مثلا  
bindKey ( key, "down", function() 
local account=getAccountName( getPlayerAccount( هنا اللاعب الي ضغط الزر ) 
if isObjectInACLGroup("user.".. account, aclGetGroup("Console") ) then 
-- your code 
end 
end    ) 

bindKey ( player thePlayer, string key, string keyState, function handlerFunction,  [ var arguments, ... ] ) 

Edit :

Server Side

local Group = "Console" 
local Key = "Key" 
addEventHandler("onResourceStart", resourceRoot, function( ) 
    for k,v in ipairs(getElementsByType("player")) do 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)), aclGetGroup(Group)) then 
            bindKey(v, Key, "down", BindKeyFunction) 
        end 
    end 
end) 
  
addEventHandler("onPlayerLogin", root, function(_, account) 
    if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(Group)) then 
        bindKey(source, Key, "down", BindKeyFunction) 
    end  
end) 
  
function BindKeyFunction(plr) 
    outputChatBox("Hello World", plr, 255, 255, 0) 
end 

Edited by Guest
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...