7REF_MTA Posted March 11, 2016 Share Posted March 11, 2016 بدي اول ماضغط علي الزر ينقل اللاعب مكان وياخذ منه فلوس شوفو الكود ذا --client ذا لسحب الفلوس حق الانتقال سهل function takeCash if(source == GUIEditor.button[4]) then bool takePlayerMoney ( int 150000 ) end) addCommandHandler ( "takeCash", takeCash ) -- server function takeCash ( thePlayer, command, 150000 ) -- when the takecash command is called takePlayerMoney ( thePlayer, tonumber(150000) ) -- take the amount of money from the player end addCommandHandler ( "takeCash", takeCash ) Link to comment
Abdul KariM Posted March 11, 2016 Share Posted March 11, 2016 ماشوف اي كود حق ضغط على الزر ناسخ مثال الويكي Link to comment
Ja[B]er[X]Pro Posted March 11, 2016 Share Posted March 11, 2016 بدي اول ماضغط علي الزر ينقل اللاعب مكان وياخذ منه فلوس شوفو الكود ذا --client ذا لسحب الفلوس حق الانتقال سهل function takeCash if(source == GUIEditor.button[4]) then bool takePlayerMoney ( int 150000 ) end) addCommandHandler ( "takeCash", takeCash ) -- server function takeCash ( thePlayer, command, 150000 ) -- when the takecash command is called takePlayerMoney ( thePlayer, tonumber(150000) ) -- take the amount of money from the player end addCommandHandler ( "takeCash", takeCash ) addEventHandler("onClientGUIClick",root, function() if (source = GUIEditor.button[4]) then setElementPosition( localPlayer, x,y,z) takePlayerMoney( localPlayer , 150000 ) end end) --[[ GUIEditor.button[4] ضع مكانه اسم الزر الذي تبيه x,y,z ضع مكانها الاحداثيات 150000 دي الفلوس ضع اي عدد تبيه ]]-- Link to comment
Ahmed Ly Posted March 11, 2016 Share Posted March 11, 2016 جرب كلنت function takeCash () if source == GUIEditor.button[4] then triggerServerEvent("onbuy",localPlayer) end end addEventHandler("onClientGUIClick",root,takeCash) سيرفر addEvent("onbuy", true) addEventHandler("onbuy", root, function() local PlayerMoney = getPlayerMoney(source) if PlayerMoney >= 500 then takePlayerMoney(source, 500) setElementPosition(source,x,y,z) end end ) Link to comment
7REF_MTA Posted March 11, 2016 Author Share Posted March 11, 2016 ماشوف اي كود حق ضغط على الزر ناسخ مثال الويكي ترا انا ماني المبرمج اللي يعرف كل شي انا اروح ادور في الويكي واشوف الامثلة واحاول اضيف لها اشياء او زر او شي Link to comment
ivor Posted March 12, 2016 Share Posted March 12, 2016 ترا اخوي بعطيك مثال الحين صبر بفتح الجهاز واللعبه اعطني الماكن الى تبي عند ضغط الزر عليه ينقلك لهُ Link to comment
Mr.Wolf Posted March 12, 2016 Share Posted March 12, 2016 تفضل اختصرت لك كل شيء ضض client side function setPlayerPosition ( x , y , z , price ) triggerServerEvent("onPlayerPosition",localPlayer,x,y,z,price) end -- Ex bindKey("x","down", function ( ) setPlayerPosition ( 0 , 0 , 2 , 5000 ) end) server side addEvent("onPlayerPosition",true) addEventHandler("onPlayerPosition",root, function ( x , y , z , price ) if ( tonumber ( price ) ) then if ( getPlayerMoney ( client ) >= tonumber ( price ) ) then takePlayerMoney ( client , tonumber ( price ) ) setElementPosition ( client , x , y , z ) else outputChatBox("* You Don't Have "..tonumber(price),client,255,255,0,true) end end 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