z24d Posted October 19, 2015 Share Posted October 19, 2015 السلام عليكم عندي كود بالكلاينت شغال علا حدث ابيه يتأكد انه ادمن او لا بس ماعرفت الطريقة 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
z24d Posted October 19, 2015 Author Share Posted October 19, 2015 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
z24d Posted October 19, 2015 Author Share Posted October 19, 2015 سويتها بالداتا ماضبطت سويتها بالتحقق نفس الشيء تابل التفت سلم علينا Link to comment
Rockyz Posted October 19, 2015 Share Posted October 19, 2015 طيب قول لنا وش تبي تسوي ؟ وثاني مرة عدل اسامي مواضيعك Link to comment
z24d Posted October 19, 2015 Author Share Posted October 19, 2015 ابي اذا ضغط انتر وشاف التيم وطلع تيم ادمن يقوله انت موب ادمن وصلى الله عالنبي Link to comment
Me[Z]oO Posted October 19, 2015 Share Posted October 19, 2015 اعمل تحقق لو اللاعب بالجروب الي انت تبيه if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)),aclGetGroup("اسم الجروب")) ) then Link to comment
z24d Posted October 19, 2015 Author Share Posted October 19, 2015 (edited) 8 Edited October 19, 2015 by Guest Link to comment
z24d Posted October 19, 2015 Author Share Posted October 19, 2015 سيرفر 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
' A F . Posted October 19, 2015 Share Posted October 19, 2015 استخدم Event : 'onResourceStart' 'onPlayerLogin' 'onPlayerLogout' Functions : getElementsByType -- player isGuestAccount getPlayerAccount getAccountName isObjectInACLGroup setElementData getElementData removeElementData Link to comment
3NAD Posted October 20, 2015 Share Posted October 20, 2015 سيرفر function Adminzz() if ( hasObjectPermissionTo ( source, "function.slap" ) ) then triggerClientEvent(source,"checkIfAdmin") end end source = ?? غير معروف -- اطرح الأكواد كاملة . Link to comment
z24d Posted October 21, 2015 Author Share Posted October 21, 2015 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
Rockyz Posted October 21, 2015 Share Posted October 21, 2015 كيف تضيف الفنكشن قبل الحدث ؟ Link to comment
' A F . Posted October 21, 2015 Share Posted October 21, 2015 (edited) يأخوي قلتلك سوي يوم يشتغل المود سوي لوب وتحقق انه مسجل دخول و بقروب ادمن وعطه داتا وللتسجيل الدخول نفس الشيء تحقق انه ادمن ولو سجل خروج تحقق انه ادمن وشيل منه الداتا Edited October 21, 2015 by Guest Link to comment
z24d Posted October 21, 2015 Author Share Posted October 21, 2015 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
' A F . Posted October 21, 2015 Share Posted October 21, 2015 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
z24d Posted October 21, 2015 Author Share Posted October 21, 2015 kfooooooooooooo ma89rt ya4eb brb noooooooom y36ek al3afyeh Link to comment
' A F . Posted October 21, 2015 Share Posted October 21, 2015 العفو حياك الله , نؤم العوافي Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now