MR.S3D Posted March 16, 2013 Share Posted March 16, 2013 (edited) -- server side Vh = {} addEvent("getCar", true) addEventHandler("getCar", getRootElement(), function () local playerMoney = getPlayerMoney(source) if playerMoney >= 25000 then local x, y, z = getElementPosition (source) if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end takePlayerMoney (source,25000) Vh[source] = createVehicle ( 413, x, y, z ) if Vh[source] then setVehicleColor( Vh[source], math.random( 255 ), math.random( 255 ), math.random( 255 ) ) warpPedIntoVehicle(source, Vh[source]) outputChatBox("#070707#0099ccThis car for you#ff0000 only",source,0,255,0,true) end else outputChatBox(" >>#070707#0099ccYou'r Not Have #070707>>#FF000025000$ !",source,255,0,0,true) end end ) addEventHandler( 'onPlayerQuit', root, function() if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end end) Edited March 16, 2013 by Guest Link to comment
===|OSAMA|=== Posted March 16, 2013 Share Posted March 16, 2013 -- server side Vh = {} addEvent("getCar", true) addEventHandler("getCar", getRootElement(), function () local playerMoney = getPlayerMoney(source) if playerMoney >= 25000 then local x, y, z = getElementPosition (source) if Vh[source] and isElement(Vh[source]) then destroyElemnt(Vh[source]) Vh[source] = nil end takePlayerMoney (source,25000) Vh[source] = createVehicle ( 413, x, y, z ) if Vh[source] then setVehicleColor( Vh[source], math.random( 255 ), math.random( 255 ), math.random( 255 ) ) warpPedIntoVehicle(source, Vh[source]) outputChatBox("#070707#0099ccThis car for you#ff0000 only",source,0,255,0,true) end else outputChatBox(" >>#070707#0099ccYou'r Not Have #070707>>#FF000025000$ !",source,255,0,0,true) end end ) addEventHandler( 'onPlayerQuit', root, function() if Vh[source] and isElement(Vh[source]) then destroyElemnt(Vh[source]) Vh[source] = nil end end) destroyElement سعد ، عندكـ لما تنفجر السيارة ما يسحبها + في عندكـ خطأ بسيط بحرف من كلمة عالعموم بس غير سطر رقم 12 , من destroyElemnt(Vh[source]) إلى destroyElement(Vh[source]) + غير سطر رقم 30 من destroyElemnt(Vh[source]) إلى destroyElement(Vh[source]) + ضيف هالكود بسطر 35 addEventHandler ( "onVehicleExplode", root, function ( ) setTimer( destroyElement, 2000, 1, source ) end ) Link to comment
MR.S3D Posted March 16, 2013 Share Posted March 16, 2013 خذ الكود مره ثانية كتبته بسرعه من دون لا ألاحظ -- server side Vh = {} addEvent("getCar", true) addEventHandler("getCar", getRootElement(), function () local playerMoney = getPlayerMoney(source) if playerMoney >= 25000 then local x, y, z = getElementPosition (source) if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end takePlayerMoney (source,25000) Vh[source] = createVehicle ( 413, x, y, z ) if Vh[source] then setVehicleColor( Vh[source], math.random( 255 ), math.random( 255 ), math.random( 255 ) ) warpPedIntoVehicle(source, Vh[source]) outputChatBox("#070707#0099ccThis car for you#ff0000 only",source,0,255,0,true) end else outputChatBox(" >>#070707#0099ccYou'r Not Have #070707>>#FF000025000$ !",source,255,0,0,true) end end ) addEventHandler( 'onPlayerQuit', root, function() if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end end) addEventHandler ( "onVehicleExplode", root, function ( ) setTimer( destroyElement, 2000, 1, source ) end ) Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 خذ الكود مره ثانية كتبته بسرعه من دون لا ألاحظ -- server side Vh = {} addEvent("getCar", true) addEventHandler("getCar", getRootElement(), function () local playerMoney = getPlayerMoney(source) if playerMoney >= 25000 then local x, y, z = getElementPosition (source) if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end takePlayerMoney (source,25000) Vh[source] = createVehicle ( 413, x, y, z ) if Vh[source] then setVehicleColor( Vh[source], math.random( 255 ), math.random( 255 ), math.random( 255 ) ) warpPedIntoVehicle(source, Vh[source]) outputChatBox("#070707#0099ccThis car for you#ff0000 only",source,0,255,0,true) end else outputChatBox(" >>#070707#0099ccYou'r Not Have #070707>>#FF000025000$ !",source,255,0,0,true) end end ) addEventHandler( 'onPlayerQuit', root, function() if Vh[source] and isElement(Vh[source]) then destroyElement(Vh[source]) Vh[source] = nil end end) addEventHandler ( "onVehicleExplode", root, function ( ) setTimer( destroyElement, 2000, 1, source ) end ) يعطيكم الف عافيه ما قصرتم. Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 مم خليت النافذه ما تفتح الا لقروب معين... طلع كودي ملخبط وجربت كود تابل : Client Side ! function () if not guiGetVisible(theWindow) then guiSetVisible(theWindow, true) showCursor(true) else guiSetVisible(theWindow, false) showCursor(false) end end) Server Side ! addEventHandler("onPlayerLogin", root, function(_,acc) local accName = getAccountName(acc) if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then bindKey(source, "F2", "down", openWindow) end end) function openWindow(player) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then triggerClientEvent(player,"OpenWindow",player) end end ولكن اللوحه ما تطلع + ضفت المود لقروب الادمن Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 مسوي ترايقر ومافية ايفنت سحر مثلا؟ Link to comment
3NAD Posted March 16, 2013 Share Posted March 16, 2013 -- Server Side aOpen_ = function ( plr_ ) local plrAccount = getPlayerAccount ( plr_ ) if not isGuestAccount ( plrAccount ) then if isObjectInACLGroup ("user."..getAccountName ( plrAccount ), aclGetGroup ( "Console" ) ) then triggerClientEvent ( plr_, "OpenWindow", plr_ ) end end end for _, v in ipairs (getElementsByType ( "player" ) ) do bindKey ( v, "f2", "down", aOpen_ ) end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "f2", "down", aOpen_ ) end ) -- Client Side addEvent ( "OpenWindow", true ) addEventHandler ( "OpenWindow", root, function ( ) if not guiGetVisible(theWindow) then guiSetVisible(theWindow, true) showCursor(true) else guiSetVisible(theWindow, false) showCursor(false) end end ) Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 مسوي ترايقر ومافية ايفنت سحر مثلا؟ وجربت كود تابل Link to comment
PaiN^ Posted March 16, 2013 Share Posted March 16, 2013 معليش أخوي عناد عندي سؤال شاطح شوي أنا لاحظت إنك تستخدمم ( _ ) في كل أكوادك تقريباً aOpen_ , plr_ هل هي لها تأثير على الكود أو شي إنت متعود عليه ؟ Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 لول شوف رد عناد واعرف كيف اقصد الايفنت ! Link to comment
3NAD Posted March 16, 2013 Share Posted March 16, 2013 معليش أخوي عناد عندي سؤال شاطح شويأنا لاحظت إنك تستخدمم ( _ ) في كل أكوادك تقريباً aOpen_ , plr_ هل هي لها تأثير على الكود أو شي إنت متعود عليه ؟ فيها تأثير سحري .. Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 معليش أخوي عناد عندي سؤال شاطح شويأنا لاحظت إنك تستخدمم ( _ ) في كل أكوادك تقريباً aOpen_ , plr_ هل هي لها تأثير على الكود أو شي إنت متعود عليه ؟ فيها تأثير سحري .. يمزح مافيها شيء Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 (edited) -- Server Side aOpen_ = function ( plr_ ) local plrAccount = getPlayerAccount ( plr_ ) if not isGuestAccount ( plrAccount ) then if isObjectInACLGroup ("user."..getAccountName ( plrAccount ), aclGetGroup ( "Console" ) ) then triggerClientEvent ( plr_, "OpenWindow", plr_ ) end end end for _, v in ipairs (getElementsByType ( "player" ) ) do bindKey ( v, "f2", "down", aOpen_ ) end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "f2", "down", aOpen_ ) end ) -- Client Side addEvent ( "OpenWindow", true ) addEventHandler ( "OpenWindow", root, function ( ) if not guiGetVisible(theWindow) then guiSetVisible(theWindow, true) showCursor(true) else guiSetVisible(theWindow, false) showCursor(false) end end ) السهم يطلع والنافذه لا : WANING: MyFolder\client.lua:109: Bad argument @ 'guiGetVisible' [Expected gui-element at argument 1, got nil] + WANING: MyFolder\client.lua:110: Bad argument @ 'guiGetVisible' [Expected gui-element at argument 1, got nil] Edited March 16, 2013 by Guest Link to comment
PaiN^ Posted March 16, 2013 Share Posted March 16, 2013 معليش أخوي عناد عندي سؤال شاطح شويأنا لاحظت إنك تستخدمم ( _ ) في كل أكوادك تقريباً aOpen_ , plr_ هل هي لها تأثير على الكود أو شي إنت متعود عليه ؟ فيها تأثير سحري .. أوكي مشكوور + يمزح مافيها شيء داري Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 لول متأكد من نافذتك؟ 100% يوم اخليها تفتح لأي احد تشتغل ويوم اخليها لقروب معين ما تشتغل Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 ورني النافذه فهمت القصهه كان في نافذتين نفس الاسم وتلخبطت lol Thanks all. Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 (edited) ^ برسستيجج كودك هذا : addEventHandler ( "onClientGUIClick", root, function ( ) if source == Background then guiStaticImageLoadImage(mainBackground,load and "1.png" or "2.png") load = not load end end ) يوم حطيت نافذتين صار يوم اضغط على الزر يغير خلفيه النافذه الثانيه والاولى ما تتغير. Edited March 16, 2013 by Guest Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 (edited) اطرح النافذه كاملة ذذ function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Back1.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(234,59,377,374,"",false) GUIEditor_Window[2] = guiCreateWindow(234,59,377,254,"",false) guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Window[2], false) Background = guiCreateButton(255,70,90,30,"Background",false,GUIEditor_Window[1]) addEventHandler ( "onClientGUIClick", root, function ( ) if source == Background then guiStaticImageLoadImage(mainBackground,load and "Back1.png" or "Back2.png") load = not load end end ) Edited March 16, 2013 by Guest Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 وين هو الزر اللي يغير اصلا ؟ واسم الصور غلطط Link to comment
فاّرس Posted March 16, 2013 Author Share Posted March 16, 2013 وين هو الزر اللي يغير اصلا ؟واسم الصور غلطط ذا موب مالي عينك Background = guiCreateButton(255,70,90,30,"Background",false,GUIEditor_Window[1]) لا اسم الصور مو غلط هي اساسا Back1.png and Back2.png بس انا كنت بخليها 1 و 2 عدلت الي فوق ونسيت الي تحت 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