S4MuEL Posted May 3, 2013 Share Posted May 3, 2013 ي الربع لآههنتمم بغيت تصحيح كود .. إذآ الاعب عندهه 2350 يسحب لهة الففلوس ويعطيه ششي ممعين مآ علينآ بس إذآ ممآ عندهه يجي بالششآت كلآمم ومآ ينفذ العمليةة ! addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[3] then triggerServerEvent("nothing",getLocalPlayer()) guiSetVisible(GUIEditor.window[2],false) showCursor(false) if getPlayerMoney ( source ) >= 2350 then takePlayerMoney ( source, 2350 ) else outputChatBox("#ff0000You do not have enough money !",source,255,255,255, true) cancelEvent() end end end ) Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 سحب الفلوس في الكلنت يكون وهمي, يعني ماله تأثير لآزم تسوي نريقر للسيرفر + لايمكن إلغاءه onClientGUIClick الحدث Link to comment
S4MuEL Posted May 3, 2013 Author Share Posted May 3, 2013 (edited) addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[3] then triggerServerEvent("nothing",getLocalPlayer()) guiSetVisible(GUIEditor.window[2],false) showCursor(false) triggerServerEvent("nothing2",getLocalPlayer()) else outputChatBox("#ff0000You do not have enough money !",source,255,255,255, true) cancelEvent() end end end ) server -- addEvent("nothing2",true) addEventHandler("nothing2", root, function() if getPlayerMoney ( source ) >= 2350 then takePlayerMoney ( source, 2350 ) end end ) Edited May 3, 2013 by Guest Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 Client : addEventHandler ( 'onClientGUIClick', root, function () if source == GUIEditor.button[3] then triggerServerEvent ( 'nothing', localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) if getPlayerMoney ( localPlayer ) >= 2350 then triggerServerEvent('nothing2', localPlayer ) else outputChatBox('#ff0000You do not have enough money !',source,255,255,255, true) end end end ) Server : addEvent ( 'nothing2', true ) addEventHandler ( 'nothing2', root, function ( ) takePlayerMoney ( source, 2350 ) end ) يا ليت تنظم أكوادكـ Link to comment
S4MuEL Posted May 3, 2013 Author Share Posted May 3, 2013 (edited) صح لسسآنكـ بسس كتبته ع السريع بدون برنآمج edit : مآ إشتغل ! :\ Edited May 3, 2013 by Guest Link to comment
S4MuEL Posted May 3, 2013 Author Share Posted May 3, 2013 إششتغلت الأكوآد بس الممشكلةة يسوي الحدث حتى ولو مآ عندهه 2500 !! Link to comment
AboShanab Posted May 3, 2013 Share Posted May 3, 2013 Client Side ! addEventHandler ( 'onClientGUIClick', root, function () if source == GUIEditor.button[3] then if getPlayerMoney ( localPlayer ) >= 2350 then takePlayerMoney ( localPlayer, 2350 ) triggerServerEvent("nothing2", localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) else outputChatBox('#ff0000You do not have enough money !',255,255,255, true) end end end) Server Side ! addEvent("nothing2",true) addEventHandler("nothing2",root, function() -- Your Code end) اظن هيكك Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 سحب الفلوس في الكلنت يكون وهمي, يعني ماله تأثيرلآزم تسوي تريقر للسيرفر Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 هممم الكود أن متأكد منه, في أخطاء ولا ؟ Link to comment
S4MuEL Posted May 3, 2013 Author Share Posted May 3, 2013 لآ كل شي ظآبطط بس الممشكلةة حتى لو ممآ عندهه الففلوس ينففذ العممليةة ^ Link to comment
فاّرس Posted May 3, 2013 Share Posted May 3, 2013 addEventHandler ( 'onClientGUIClick', root, function () if (source == GUIEditor.button[3]) then guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) triggerServerEvent('nothing2', localPlayer ) end end) addEvent ( 'nothing2', true ) addEventHandler ( 'nothing2', root, function () if getPlayerMoney ( source ) >= 2350 then takePlayerMoney ( source, 2350 ) else outputChatBox('#ff0000You do not have enough money !',source,255,255,255, true) end end) Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 الكودين صح ._. ورني الكود كامل لآهنت Link to comment
S4MuEL Posted May 3, 2013 Author Share Posted May 3, 2013 GUIEditor = { button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(477, 224, 302, 140, ".| Boat Rental ! |.", false) guiWindowSetSizable(GUIEditor.window[1], false) guiWindowSetMovable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetVisible(GUIEditor.window[1],false) GUIEditor.label[1] = guiCreateLabel(74, 26, 172, 17, "Do You Want Rental a Boat ? !", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 5, 249, 5) GUIEditor.button[1] = guiCreateButton(183, 53, 103, 50, "No , i Don't !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFC0000") GUIEditor.label[2] = guiCreateLabel(165, 113, 131, 17, "Created By #iR4y[b]ak", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 4, 147, 247) GUIEditor.button[2] = guiCreateButton(34, 53, 103, 50, "Yes , i Want !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFD2F00D") GUIEditor.window[2] = guiCreateWindow(521, 239, 256, 161, ".| The Confirmation ! |.", false) guiSetVisible(GUIEditor.window[2],false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.label[3] = guiCreateLabel(81, 27, 93, 20, "Are You Sure ? !", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.label[4] = guiCreateLabel(41, 63, 175, 19, "you Want To Rent The Boat At :", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[4], 8, 170, 246) GUIEditor.label[5] = guiCreateLabel(106, 92, 58, 18, "2350 $ .. '", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[5], 15, 243, 10) GUIEditor.button[3] = guiCreateButton(27, 110, 69, 33, "Yes !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFE55A16") GUIEditor.button[4] = guiCreateButton(174, 110, 69, 33, "No !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFA08C9") local Marker = createMarker ( -1520.64453, 1014.02814, 7.18750 - 1, "cylinder",2,255,0,0.5,255) createBlipAttachedTo(Marker,23) addEventHandler("onClientMarkerHit", Marker, function (player) if (getElementType(player) == ("player") ) then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end ) addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) if ( guiGetVisible ( GUIEditor.window[1] ) == false ) then guiSetVisible(GUIEditor.window[2],true) showCursor(true) end end end ) addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[4] then guiSetVisible(GUIEditor.window[2],false) showCursor(false) end end ) addEventHandler ( 'onClientGUIClick', root, function () if source == GUIEditor.button[3] then triggerServerEvent ( 'nothing', localPlayer ) triggerServerEvent('nothing2', localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) end end ) Link to comment
iPrestege Posted May 3, 2013 Share Posted May 3, 2013 GUIEditor = { button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(477, 224, 302, 140, ".\"{SMILIES_PATH}/icon_neutral.gif\" alt=\"\" title=\"Neutral\" /> Boat Rental ! |:.", false) guiWindowSetSizable(GUIEditor.window[1], false) guiWindowSetMovable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetVisible(GUIEditor.window[1],false) GUIEditor.label[1] = guiCreateLabel(74, 26, 172, 17, "Do You Want Rental a Boat ? !", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 5, 249, 5) GUIEditor.button[1] = guiCreateButton(183, 53, 103, 50, "No , i Don't !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFC0000") GUIEditor.label[2] = guiCreateLabel(165, 113, 131, 17, "Created By #iR4y[b]ak", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 4, 147, 247) GUIEditor.button[2] = guiCreateButton(34, 53, 103, 50, "Yes , i Want !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFD2F00D") GUIEditor.window[2] = guiCreateWindow(521, 239, 256, 161, ".\"{SMILIES_PATH}/icon_neutral.gif\" alt=\"\" title=\"Neutral\" /> The Confirmation ! |:.", false) guiSetVisible(GUIEditor.window[2],false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.label[3] = guiCreateLabel(81, 27, 93, 20, "Are You Sure ? !", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.label[4] = guiCreateLabel(41, 63, 175, 19, "you Want To Rent The Boat At :", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[4], 8, 170, 246) GUIEditor.label[5] = guiCreateLabel(106, 92, 58, 18, "2350 $ .. '", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[5], 15, 243, 10) GUIEditor.button[3] = guiCreateButton(27, 110, 69, 33, "Yes !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFE55A16") GUIEditor.button[4] = guiCreateButton(174, 110, 69, 33, "No !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFA08C9") local Marker = createMarker ( -1520.64453, 1014.02814, 7.18750 - 1, "cylinder",2,255,0,0.5,255) createBlipAttachedTo(Marker,23) addEventHandler("onClientMarkerHit", Marker, function (player) if player == getLocalPlayer() then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end ) addEventHandler ( 'onClientGUIClick', root, function ( ) if source == GUIEditor.button[3] then triggerServerEvent ( 'nothing', localPlayer ) triggerServerEvent('nothing2', localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) elseif source == GUIEditor.button[4] then guiSetVisible(GUIEditor.window[2],false) showCursor(false) elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) elseif source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) Link to comment
iPrestege Posted May 3, 2013 Share Posted May 3, 2013 فية خطأ كودي عكست شيء <> GUIEditor = { button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(477, 224, 302, 140, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiWindowSetMovable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) guiSetVisible(GUIEditor.window[1],false) GUIEditor.label[1] = guiCreateLabel(74, 26, 172, 17, "Do You Want Rental a Boat ? !", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 5, 249, 5) GUIEditor.button[1] = guiCreateButton(183, 53, 103, 50, "No , i Don't !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFC0000") GUIEditor.label[2] = guiCreateLabel(165, 113, 131, 17, "Created By #iR4y[b]ak", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 4, 147, 247) GUIEditor.button[2] = guiCreateButton(34, 53, 103, 50, "Yes , i Want !", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFD2F00D") GUIEditor.window[2] = guiCreateWindow(521, 239, 256, 161, "", false) guiSetVisible(GUIEditor.window[2],false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.label[3] = guiCreateLabel(81, 27, 93, 20, "Are You Sure ? !", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.label[4] = guiCreateLabel(41, 63, 175, 19, "you Want To Rent The Boat At :", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[4], 8, 170, 246) GUIEditor.label[5] = guiCreateLabel(106, 92, 58, 18, "2350 $ .. '", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[5], 15, 243, 10) GUIEditor.button[3] = guiCreateButton(27, 110, 69, 33, "Yes !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFE55A16") GUIEditor.button[4] = guiCreateButton(174, 110, 69, 33, "No !", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFA08C9") local Marker = createMarker ( -1520.64453, 1014.02814, 7.18750 - 1, "cylinder",2,255,0,0.5,255) createBlipAttachedTo(Marker,23) addEventHandler("onClientMarkerHit", Marker, function (player) if player == getLocalPlayer() then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end ) addEventHandler ( 'onClientGUIClick', root, function ( ) if source == GUIEditor.button[3] then triggerServerEvent ( 'nothing', localPlayer ) triggerServerEvent('nothing2', localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) elseif source == GUIEditor.button[4] then guiSetVisible(GUIEditor.window[2],false) showCursor(false) elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) guiSetVisible(GUIEditor.window[2],true) elseif source == GUIEditor.button[1] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) Link to comment
S4MuEL Posted May 4, 2013 Author Share Posted May 4, 2013 نففس الشي ، ينففذ العممليةة ^ + السيرففر Vehicle = {} addEvent("nothing", true) addEventHandler("nothing",getRootElement(),function () if not Vehicle[source] then Vehicle[source] = {} end if isElement ( Vehicle[source]['myBilp'] ) then destroyElement(Vehicle[source]['myBilp']) elseif isElement ( Vehicle[source]['myVehicle'] ) then destroyElement(Vehicle[source]['myVehicle']) end Vehicle[source]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341e-005,269.57095336914 ) warpPedIntoVehicle(source,Vehicle[source]['myVehicle']) Vehicle[source]['myBilp'] = createBlipAttachedTo(Vehicle[source]['myVehicle'],9) setElementModel(source,45) end ) addEventHandler("onVehicleStartExit",getRootElement(), function (plr) if ( Vehicle[plr] and Vehicle[plr]['myVehicle'] and isElement ( Vehicle[plr]['myVehicle'] ) ) then cancelEvent( true ) end end ) addEventHandler("onPlayerQuit",root, function ( ) if ( Vehicle[source] ) then if isElement ( Vehicle[source]['myBilp'] ) then destroyElement(Vehicle[source]['myBilp']) elseif isElement ( Vehicle[source]['myVehicle'] ) then destroyElement(Vehicle[source]['myVehicle']) end Vehicle[source] = nil end end ) local Marker2 = createMarker ( -1481.17139, 1029.08521, -0.55000, "checkpoint",10,255,0,0.5,255) addEventHandler("onMarkerHit",Marker2, function () local car = getPedOccupiedVehicle(source) if car then destroyElement ( car ) end end ) addEvent ( 'nothing2', true ) addEventHandler ( 'nothing2', root, function () if getPlayerMoney ( source ) >= 2350 then takePlayerMoney ( source, 2350 ) else outputChatBox('#ff0000You do not have enough money !',source,255,255,255, true) end end) Link to comment
3NAD Posted May 4, 2013 Share Posted May 4, 2013 ي الربع لآههنتممبغيت تصحيح كود .. إذآ الاعب عندهه 2350 يسحب لهة الففلوس ويعطيه ششي ممعين مآ علينآ بس إذآ ممآ عندهه يجي بالششآت كلآمم ومآ ينفذ العمليةة ! addEventHandler("onClientGUIClick", root, function () if source == GUIEditor.button[3] then triggerServerEvent("nothing",getLocalPlayer()) guiSetVisible(GUIEditor.window[2],false) showCursor(false) if getPlayerMoney ( source ) >= 2350 then takePlayerMoney ( source, 2350 ) else outputChatBox("#ff0000You do not have enough money !",source,255,255,255, true) cancelEvent() end end end ) -- Client Side addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor.button[3] then if getPlayerMoney ( ) >= 2350 then triggerServerEvent ( "nothing", localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) else return outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) end end end ) -- Server Side addEvent ( "nothing", true ) addEventHandler ( "nothing", root, function ( player ) takePlayerMoney ( player, 2350 ) end ) Link to comment
S4MuEL Posted May 4, 2013 Author Share Posted May 4, 2013 ممآ صآر يشتغل آصصلآ ، ي عنآد آنآ معي ترآيقرين وآحد nothing = لـ سيآرةة nothing2 = للففلوسس Link to comment
iPrestege Posted May 4, 2013 Share Posted May 4, 2013 ولية مآتسوية كلة بـ ترايقر واحد وتنظم الاكواد Link to comment
S4MuEL Posted May 4, 2013 Author Share Posted May 4, 2013 صصرت ملخخبط ششوي صصرآحةة ! تققدر تنظمم الكود لي ؟ + السيرففر Vehicle = {} addEvent("nothing", true) addEventHandler("nothing",getRootElement(),function () if not Vehicle[source] then Vehicle[source] = {} end if isElement ( Vehicle[source]['myBilp'] ) then destroyElement(Vehicle[source]['myBilp']) elseif isElement ( Vehicle[source]['myVehicle'] ) then destroyElement(Vehicle[source]['myVehicle']) end Vehicle[source]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341e-005,269.57095336914 ) warpPedIntoVehicle(source,Vehicle[source]['myVehicle']) Vehicle[source]['myBilp'] = createBlipAttachedTo(Vehicle[source]['myVehicle'],9) setElementModel(source,45) end ) addEventHandler("onVehicleStartExit",getRootElement(), function (plr) if ( Vehicle[plr] and Vehicle[plr]['myVehicle'] and isElement ( Vehicle[plr]['myVehicle'] ) ) then cancelEvent( true ) end end ) addEventHandler("onPlayerQuit",root, function ( ) if ( Vehicle[source] ) then if isElement ( Vehicle[source]['myBilp'] ) then destroyElement(Vehicle[source]['myBilp']) elseif isElement ( Vehicle[source]['myVehicle'] ) then destroyElement(Vehicle[source]['myVehicle']) end Vehicle[source] = nil end end ) local Marker2 = createMarker ( -1481.17139, 1029.08521, -0.55000, "checkpoint",10,255,0,0.5,255) addEventHandler("onMarkerHit",Marker2, function () local car = getPedOccupiedVehicle(source) if car then destroyElement ( car ) end end ) addEvent ( "nothing2", true ) addEventHandler ( "nothing2", root, function ( player ) takePlayerMoney ( player, 2350 ) end ) Link to comment
K1NG Posted May 4, 2013 Share Posted May 4, 2013 -- Client Side addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor.button[3] then if getPlayerMoney ( ) >= 2350 then triggerServerEvent ( "nothing", localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) else return outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) end end end ) هنا ؛ مثل عدم وجودها return وجود -- Server Side addEvent ( "nothing", true ) addEventHandler ( "nothing", root, function ( player ) takePlayerMoney ( player, 2350 ) end ) player = ?? لازم تعرفه بالتريقر من جانب كلنت .. ثم تعرفه بالفنكشن بجانب سيرفر + ما يحتاج تسوي كل ذا ، يمديكـ تسويه بالطريقة ذي .. -- Client Side # addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[3] ) then if ( getPlayerMoney ( ) >= 2350 ) then triggerServerEvent ( "nothing", localPlayer ) guiSetVisible ( GUIEditor.window[2], false ) showCursor ( false ) else outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) end end end ) -- Server Side # addEvent ( "nothing", true ) addEventHandler ( "nothing", root, function ( ) takePlayerMoney ( client, 2350 ) end ) 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