Code Posted July 6, 2013 Share Posted July 6, 2013 (edited) السلام عليكم .. ما المشكله بهذا الكود ؟ addEvent("Repair",true) addEventHandler("Repair",root, function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) fixVehicle(getPedOccupiedVehicle(source)) outputChatBox("#FF0000*#0099FF You've bought repair",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) -- addEvent("Flip",true) addEventHandler("Flip",root, function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) rx, ry, rz = getVehicleRotation(getPedOccupiedVehicle(source)) setVehicleRotation (getPedOccupiedVehicle(source), 0, 0, rx > 90 and rx < 279 and rz + 180 or rz) outputChatBox("#FF0000*#0099FF You've bought flip",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) -- addEvent("Nitro",true) addEventHandler("Nitro",root, function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) outputChatBox("#FF0000*#0099FF You've bought a nitro",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) -- addEvent("Invisible",true) addEventHandler("Invisible",root, function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) setElementAlpha(getPedOccupiedVehicle(source),0) setElementAlpha(source,0) setPlayerNametagShowing(source, false) setTimer( setElementAlpha, 60000, 1, source, 500, true) setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) outputChatBox("#FF0000*#0099FF You've bought invisible",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) bindKey( source, "1", "down", function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) fixVehicle(getPedOccupiedVehicle(source)) outputChatBox("#FF0000*#0099FF You've bought repair",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) bindKey( source, "2", "down", function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) outputChatBox("#FF0000*#0099FF You've bought a nitro",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) bindKey( source, "3", "down", function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) rx, ry, rz = getVehicleRotation(getPedOccupiedVehicle(source)) setVehicleRotation (getPedOccupiedVehicle(source), 0, 0, rx > 90 and rx < 279 and rz + 180 or rz) outputChatBox("#FF0000*#0099FF You've bought flip",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) bindKey( source, "4", "down", function () if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) setElementAlpha(getPedOccupiedVehicle(source),0) setElementAlpha(source,0) setPlayerNametagShowing(source, false) setTimer( setElementAlpha, 60000, 1, source, 500, true) setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) outputChatBox("#FF0000*#0099FF You've bought invisible",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) Edited July 6, 2013 by Guest Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 viewtopic.php?f=160&t=46670 + قولنا وش المشكله بالضبط , ,وقولنا وش تبي تسوي ,؟ Link to comment
Code Posted July 6, 2013 Author Share Posted July 6, 2013 شوب ريس الشوب يشتغل بس المشكله الاختضارات حق الشوب رقم 3 ورقم 2 وكذا يعني لما يضغط رقم 3 يشتري نيترو ؟ عرفت ؟ Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 شوب ريس الشوب يشتغل بس المشكله الاختضارات حق الشوب رقم 3 ورقم 2 وكذا يعني لما يضغط رقم 3 يشتري نيترو ؟ عرفت ؟ اي عرفت لكن ليه مسوي اتصال بالسيرفر ؟ اقصد trigger ? + setVehicleRotation Client and Server function This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. Please use setElementRotation instead. + getVehicleRotation Client and Server function This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. Please use getElementRotation instead. Link to comment
Code Posted July 6, 2013 Author Share Posted July 6, 2013 اخي الفاضل انا مبتدي .. و تعبت ما قدرت احلهاا ..! تقدر تحلها انت ؟ Link to comment
AHMAD1234 Posted July 6, 2013 Share Posted July 6, 2013 اخي الفاضل انا مبتدي .. و تعبت ما قدرت احلهاا ..! تقدر تحلها انت ؟ المشكلة يمكن تكون من المتغيرات عندك راجعها لاهنت وتأكد منها وشيك عليها Link to comment
iMr.3a[Z]eF Posted July 6, 2013 Share Posted July 6, 2013 يخوي هو سوا كلاينت وسيرفر وبس يبي أختصارات للنيترو وزي كذا لو يضغط 1 يجي له نيترو 2 ريباير 3 انفيسبل 4 فليب وهذا كله للريس Link to comment
AHMAD1234 Posted July 6, 2013 Share Posted July 6, 2013 يخوي هو سوا كلاينت وسيرفروبس يبي أختصارات للنيترو وزي كذا لو يضغط 1 يجي له نيترو 2 ريباير 3 انفيسبل 4 فليب وهذا كله للريس اهااا اجل تفضل triggerServerEvent Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 -- Client Side ! # bindKey("1","down", function() triggerServerEvent("Fix",localPlayer) end ) bindKey("2","down", function() triggerServerEvent("Nitro",localPlayer) end ) bindKey("3","down", function() triggerServerEvent("Flip",localPlayer) end ) bindKey("4","down", function() triggerServerEvent("Invisible",localPlayer) end ) -- Server Side ! # addEvent("Fix",true) addEventHandler("Fix",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) fixVehicle(getPedOccupiedVehicle(source)) outputChatBox("#FF0000*#0099FF You've bought repair",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Nitro",true) addEventHandler("Nitro",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) outputChatBox("#FF0000*#0099FF You've bought a nitro",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Flip",true) addEventHandler("Flip",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) rx, ry, rz = getElementRotation(getPedOccupiedVehicle(source)) setElementRotation (getPedOccupiedVehicle(source), 0, 0, rx > 90 and rx < 279 and rz + 180 or rz) outputChatBox("#FF0000*#0099FF You've bought flip",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Invisible",true) addEventHandler("Invisible",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) setElementAlpha(getPedOccupiedVehicle(source),0) setElementAlpha(source,0) setPlayerNametagShowing(source, false) setTimer( setElementAlpha, 60000, 1, source, 500, true) setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) outputChatBox("#FF0000*#0099FF You've bought invisible",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) Link to comment
Code Posted July 6, 2013 Author Share Posted July 6, 2013 ^ Debugscript 3 Warning: Loading Script Failed: Shop/C.lua:22 ')' expected (to close '(' at line 19 near 'eof' Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 ^Debugscript 3 Warning: Loading Script Failed: Shop/C.lua:22 ')' expected (to close '(' at line 19 near 'eof' -- Client Side ! # bindKey("1","down", function() triggerServerEvent("Fix",localPlayer) end ) bindKey("2","down", function() triggerServerEvent("Nitro",localPlayer) end ) bindKey("3","down", function() triggerServerEvent("Flip",localPlayer) end ) bindKey("4","down", function() triggerServerEvent("Invisible",localPlayer) end ) -- Server Side ! # addEvent("Fix",true) addEventHandler("Fix",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) fixVehicle(getPedOccupiedVehicle(source)) outputChatBox("#FF0000*#0099FF You've bought repair",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Nitro",true) addEventHandler("Nitro",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) outputChatBox("#FF0000*#0099FF You've bought a nitro",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Flip",true) addEventHandler("Flip",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) rx, ry, rz = getElementRotation(getPedOccupiedVehicle(source)) setElementRotation (getPedOccupiedVehicle(source), 0, 0, rx > 90 and rx < 279 and rz + 180 or rz) outputChatBox("#FF0000*#0099FF You've bought flip",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) addEvent("Invisible",true) addEventHandler("Invisible",root, function() if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 3000 ) then takePlayerMoney(source,3000) setElementAlpha(getPedOccupiedVehicle(source),0) setElementAlpha(source,0) setPlayerNametagShowing(source, false) setTimer( setElementAlpha, 60000, 1, source, 500, true) setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true) setTimer( setPlayerNametagShowing, 60000, 1, source, true, true) outputChatBox("#FF0000*#0099FF You've bought invisible",source,255,255,255,true) else outputChatBox("#FF0000You dont have enough money.",source,255,255,255,true) end else outputChatBox("You are not in the car",source,255,0,0,true) end end ) الاول كلنت والثاني سيرفر ^ Link to comment
فاّرس Posted July 6, 2013 Share Posted July 6, 2013 ^تسلم ع حل مشكلتي 'اشتغل' حياك الله # 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