Jump to content

ممكن تدخل ابي كود بسيط


abofhd

Recommended Posts

لم يتم التجربة :

Server :

-- Server Side : 
  
function Open ( player, thePlayer )   
        local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ("OpenWind", source ) 
        end 
    end 
  
  
addEventHandler ( "onResourceStart", root, 
function () 
for _,player in ipairs ( getElementsByType ( "player" ) ) do 
bindKey ( player, "F7", "down", Open ) 
    end 
end 
) 

Client :

-- Client Side : 
  
addEvent( "OpenWind", true ) 
addEventHandler( "OpenWind", localPlayer, 
function () 
    if ( removeEventHandler("onClientRender",root,FunctionName) ) then 
    removeEventHandler("onClientRender",root,FunctionName) 
    showCursor(false) 
    else 
    addEventHandler("onClientRender",root,FunctionName) 
    showCursor(true) 
    end 
) 
Edited by Guest
Link to comment
لم يتم التجربة :

Server :

function Open (  player, thePlayer )   
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ("OpenWind", source ) 
    end 
end 
  
bindKey ( player, "F7", "down", Open ) 

Client :

addEvent( "OpenWind", true ) 
addEventHandler( "OpenWind", localPlayer, 
function () 
    if ( removeEventHandler("onClientRender",root,FunctionName) ) then 
        removeEventHandler("onClientRender",root,FunctionName) 
            showCursor(false) 
        else 
    addEventHandler("onClientRender",root,FunctionName) 
showCursor(true) 
    end 
end 
) 

player = ?

طبعاً أغلببكم ناسخين هـ الكود دايم أشوفه وكل مرة أشوفه حشيش :lol:

 if ( removeEventHandler("onClientRender",root,FunctionName) ) then -- اذا الحدث محذوف 
       removeEventHandler("onClientRender",root,FunctionName) -- يحذفه مرة ثانية 

:lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol:

:bazooka::bazooka::bazooka::bazooka::bazooka::bazooka::bazooka:

Link to comment

 if ( removeEventHandler("onClientRender",root,FunctionName) ) then -- اذا الحدث محذوف 
       removeEventHandler("onClientRender",root,FunctionName) -- يحذفه مرة ثانية 

:lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol:

:bazooka::bazooka::bazooka::bazooka::bazooka::bazooka::bazooka:

يب ..

ماخدنه الكود لفتح النافذة

الكود فيه شيء ... ؟

Link to comment
لم يتم التجربة :

Server :

-- Server Side : 
  
function Open ( player, thePlayer )   
        local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ("OpenWind", source ) 
        end 
    end 
  
  
addEventHandler ( "onResourceStart", root, 
function () 
for _,player in ipairs ( getElementsByType ( "player" ) ) do 
bindKey ( player, "F7", "down", Open ) 
    end 
end 
) 

Client :

-- Client Side : 
  
addEvent( "OpenWind", true ) 
addEventHandler( "OpenWind", localPlayer, 
function () 
    removeEventHandler("onClientRender",root,FunctionName) 
    showCursor(false) 
    else 
    addEventHandler("onClientRender",root,FunctionName) 
    showCursor(true) 
    end 
) 

الكود مليان اخطاء

فاقد الشيء لا يعطيه

Link to comment

غيـر معـرف thePlayer بالسيرفر الـ

والكلنت تسوي عكس للشرط وآصلاً مافي شرط؟

F7 والسكربت أول مايشتغل يجيب اللاعبين الي موجودين و الآن هذا يعني آذاً دخل لاعب ما راح يقدر يشغل الوظيفة حقت الزر

Link to comment
-- Client 
  
bindKey('f7','down', function ( ) 
triggerServerEvent('isGroup',localPlayer) 
end) 
  
addEvent('Open',true) 
addEventHandler('Open',root,  
function ( ) 
-- Your Code 
end) 
  
-- Server  
  
addEvent('isGroup',true) 
addEventHandler('isGroup',root, function ( ) 
if ( isObjectInACLGroup ( 'user.'..getAccountName ( getPlayerAccount ( client ) ) ,aclGetGroup('Console') ) ) then 
triggerClientEvent(client,'Open',client) 
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...