MR.KING111 Posted January 16, 2013 Share Posted January 16, 2013 السلام عليكم ورحمة الله وبركاته ابي اذا اللعب دخل الماركر تفتح نافذة بس لقروب الادمن client Marker = createMarker ( -2411.6735839844,-608.75842285156,132.6333772752, "cylinder", 1.5, 255, 0, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible( shopWindow, true ) showCursor( true ) end end ) shopWindow = guiCreateWindow(370,90,640,456,"shop panel MR.KING111 ",false) guiSetVisible (shopWindow, false) guiWindowSetSizable(shopWindow,false) guiWindowSetMovable(shopWindow,true) Link to comment
Blaawee Posted January 16, 2013 Share Posted January 16, 2013 server : marker = createMarker ( -2411.6735839844, -608.75842285156, 132.6333772752, "cylinder", 1.5, 255, 0, 0, 255 ); addEventHandler( 'onMarkerHit' , marker, function( hitElement, matchingDimension ) if ( hitElement and getElementType( hitElement ) == 'player' and isObjectInACLGroup('user.'..getAccountName( getPlayerAccount( hitElement ) ), aclGetGroup( 'Admin' ) ) and matchingDimension ) then triggerClientEvent( hitElement, 'showGui', hitElement ); end end ); addEventHandler( 'onMarkerLeave', marker, function( leaveElement, matchingDimension ) if ( getElementType( leaveElement ) == "player" ) then triggerClientEvent( hitElement, 'hideGui', hitElement ); end end ); client: shopWindow = guiCreateWindow( 370, 90, 640, 456, "shop panel MR.KING111 ", false ); guiSetVisible( shopWindow, false ); guiWindowSetSizable( shopWindow, false ); guiWindowSetMovable( shopWindow, true ); addEvent( 'showGui', true ); addEventHandler( 'showGui', root, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible( myWindow, not guiGetVisible ( myWindow ) ); showCursor( guiGetVisible ( myWindow ) ); end end ); addEvent( 'hideGui', true ) addEventHandler( 'hideGui', root, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible( myWindow, not guiGetVisible ( myWindow ) ); showCursor( guiGetVisible ( myWindow ) ); end end ); Link to comment
MR.S3D Posted January 16, 2013 Share Posted January 16, 2013 server : marker = createMarker ( -2411.6735839844, -608.75842285156, 132.6333772752, "cylinder", 1.5, 255, 0, 0, 255 ); addEventHandler( 'onMarkerHit' , marker, function( hitElement, matchingDimension ) if ( hitElement and getElementType( hitElement ) == 'player' and isObjectInACLGroup('user.'..getAccountName( getPlayerAccount( hitElement ) ), aclGetGroup( 'Admin' ) ) and matchingDimension ) then triggerClientEvent( hitElement, 'showGui', hitElement ); end end ); addEventHandler( 'onMarkerLeave', marker, function( leaveElement, matchingDimension ) if ( getElementType( leaveElement ) == "player" ) then triggerClientEvent( hitElement, 'hideGui', hitElement ); end end ); client: shopWindow = guiCreateWindow( 370, 90, 640, 456, "shop panel MR.KING111 ", false ); guiSetVisible( shopWindow, false ); guiWindowSetSizable( shopWindow, false ); guiWindowSetMovable( shopWindow, true ); addEvent( 'showGui', true ); addEventHandler( 'showGui', root, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible( myWindow, not guiGetVisible ( myWindow ) ); showCursor( guiGetVisible ( myWindow ) ); end end ); addEvent( 'hideGui', true ) addEventHandler( 'hideGui', root, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible( myWindow, not guiGetVisible ( myWindow ) ); showCursor( guiGetVisible ( myWindow ) ); end end ); ماتلاحظ انك مطول الشغله كان مايحتاج انك تكرر الحدثين في الكلنت استخدمت حدث واحد وخلاص Link to comment
MR.KING111 Posted January 16, 2013 Author Share Posted January 16, 2013 في مشكلة دخلت الماركر وانا في قروب الادمن ما فتحت نافذة Link to comment
TAPL Posted January 16, 2013 Share Posted January 16, 2013 marker = createMarker(-2411.6735839844, -608.75842285156, 132.6333772752, "cylinder", 1.5, 255, 0, 0, 255) function on_Hit_Leave(hitElement, matchingDimension) if (hitElement and getElementType(hitElement) == "player" and matchingDimension) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup("Admin")) then triggerClientEvent(hitElement, "Show_Hide_Gui", hitElement, eventName) end end end addEventHandler("onMarkerHit", marker, on_Hit_Leave) addEventHandler("onMarkerLeave", marker, on_Hit_Leave) shopWindow = guiCreateWindow(370, 90, 640, 456, "shop panel MR.KING111", false) guiSetVisible(shopWindow, false) guiWindowSetSizable(shopWindow, false) guiWindowSetMovable(shopWindow, true) addEvent("Show_Hide_Gui", true) addEventHandler("Show_Hide_Gui", root, function (eventName) if eventName == "onMarkerHit" then guiSetVisible(shopWindow, true) showCursor(true) elseif eventName == "onMarkerLeave" then guiSetVisible(shopWindow, false) showCursor(false) end end) Link to comment
MR.KING111 Posted January 16, 2013 Author Share Posted January 16, 2013 marker = createMarker(-2411.6735839844, -608.75842285156, 132.6333772752, "cylinder", 1.5, 255, 0, 0, 255) function on_Hit_Leave(hitElement, matchingDimension) if (hitElement and getElementType(hitElement) == "player" and matchingDimension) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup("Admin")) then triggerClientEvent(hitElement, "Show_Hide_Gui", hitElement, eventName) end end end addEventHandler("onMarkerHit", marker, on_Hit_Leave) addEventHandler("onMarkerLeave", marker, on_Hit_Leave) shopWindow = guiCreateWindow(370, 90, 640, 456, "shop panel MR.KING111", false) guiSetVisible(shopWindow, false) guiWindowSetSizable(shopWindow, false) guiWindowSetMovable(shopWindow, true) addEvent("Show_Hide_Gui", true) addEventHandler("Show_Hide_Gui", root, function (eventName) if eventName == "onMarkerHit" then guiSetVisible(shopWindow, true) showCursor(true) elseif eventName == "onMarkerLeave" then guiSetVisible(shopWindow, false) showCursor(false) end end) مشكوووووووووووووور اشتغل الكود 100% وشكرا لكل لردو 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