Jump to content

* [Question]


z24d

Recommended Posts

السلام عليكم عندي كود بالكلاينت شغال علا حدث ابيه يتأكد انه ادمن او لا بس ماعرفت الطريقة

addEvent("checkIfAdmin",true) 
function EnterSpawn() 
    if team == "Admin" then -- 
    addEventHandler("checkIfAdmin",source,function() 
    if not ( getPlayerTeam(localPlayer) == getTeamFromName("Admin") ) then return triggerServerEvent("cantJoin",localPlayer)end  
    end) 
    else 
    unbindKey("arrow_l", "down", sLeft) 
    unbindKey("arrow_r", "down", sRight) 
    unbindKey("enter", "down", EnterSpawn) 
    showPlayerHudComponent("all", true) 
    removeEventHandler("onClientPreRender", root, drawTeamName) 
    destroyElement(sPed) 
    triggerServerEvent("spawnMe", localPlayer, skinID, sX, sY, sZ, sR, team) 
end 
end 

سيرفر

function Adminzz() 
if ( hasObjectPermissionTo ( source, "function.slap" ) ) then 
triggerClientEvent(source,"checkIfAdmin") 
end 
end 

Link to comment
addEvent("checkIfAdmin",true) 
function EnterSpawn() 
    if team == "Admin" then  
addEventHandler("checkIfAdmin",root, 
function(dataYes) 
    if not ( dataYes == false ) then return triggerServerEvent("cantJoin",localPlayer ) 
end  
end) 

server

addEventHandler("onPlayerLogin",root, 
function () 
if ( hasObjectPermissionTo ( source, "function.slap" ) ) then 
dataYes = getElementData(source,"HesAdmin") 
triggerClientEvent(source,"checkIfAdmin",source,dataYes) 
setElementData(source,dataYes,true) 
end 
end 
) 

Link to comment

سيرفر

function Adminzz() 
if ( hasObjectPermissionTo ( source, "function.slap" ) ) then 
triggerClientEvent(source,"checkIfAdmin") 
end 
end 

addEvent("checkIfAdmin",true) 
function EnterSpawn() 
    if team == "Admin" then -- 
    addEventHandler("checkIfAdmin",source,function() 
    if not ( هنا شلون احقق انه ادمن؟ ) then return triggerServerEvent("cantJoin",localPlayer)end 
    end) 
    else 
    unbindKey("arrow_l", "down", sLeft) 
    unbindKey("arrow_r", "down", sRight) 
    unbindKey("enter", "down", EnterSpawn) 
    showPlayerHudComponent("all", true) 
    removeEventHandler("onClientPreRender", root, drawTeamName) 
    destroyElement(sPed) 
    triggerServerEvent("spawnMe", localPlayer, skinID, sX, sY, sZ, sR, team) 
end 
end 

Link to comment
function Adminzz() 
if ( hasObjectPermissionTo ( source, "function.slap" ) ) then 
triggerClientEvent(source,"checkIfAdmin") 
end 
end 
addEventHandler("onPlayerLogin",root,Adminzz) 
  
--Client Side 
addEvent("checkIfAdmin",true) 
function EnterSpawn() 
    if team == "Admin" then -- 
    addEventHandler("checkIfAdmin",source,function() 
    if not ( ابي اعرف شلون اتحقق انه ادمن او لا ) then return triggerServerEvent("cantJoin",localPlayer)end 
    end) 
    else 
    unbindKey("arrow_l", "down", sLeft) 
    unbindKey("arrow_r", "down", sRight) 
    unbindKey("enter", "down", EnterSpawn) 
    showPlayerHudComponent("all", true) 
    removeEventHandler("onClientPreRender", root, drawTeamName) 
    destroyElement(sPed) 
    triggerServerEvent("spawnMe", localPlayer, skinID, sX, sY, sZ, sR, team) 
end 
end 

Link to comment

يأخوي قلتلك

سوي يوم يشتغل المود

سوي لوب وتحقق انه مسجل دخول و بقروب ادمن وعطه داتا

وللتسجيل الدخول نفس الشيء تحقق انه ادمن ولو سجل خروج تحقق انه ادمن وشيل منه الداتا

Edited by Guest
Link to comment
 addEventHandler("onPlayerLogin",root, 
function() 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then 
theData = getElementData(player,"trueCheck") 
setElementData(player,theData,true) 
end 
end 
) 
addEventHandler("onPlayerLogout",root, 
function() 
if ( theData == true ) then 
removeElementData(player,theData) 
end 
end 
) 
  

onResourceStart

ماعرفت وش دخله

Link to comment
addEventHandler('onResourceStart',resourceRoot, 
function ( )  
for i,player in ipairs ( getElementsByType('player') ) do  
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
if ( isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)),aclGetGroup('Admin') ) ) then 
setElementData ( player , 'Admin' , true )  
                    end 
            end 
    end 
end) 
  
addEventHandler('onPlayerLogin',root, 
function ( ) 
if ( isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(source)),aclGetGroup('Admin') ) ) then 
setElementData ( source , 'Admin' , true ) 
        end 
end) 
  
  
addEventHandler('onPlayerLogout',root, function ( ) 
if ( isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(source)),aclGetGroup('Admin') ) ) then 
removeElementData(source,'Admin') 
    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...