nxFairlywell Posted July 20, 2014 Share Posted July 20, 2014 ألَسلآم عليكم ورحمة الله وبركاته , اليوم سويت لوحة حق المعرض , والله سويت كل الاكواد , بس فيه ممشكلة مادري وش هي بالضبط server side -- addEvent("GIVE", true) function give() if ( getPlayerMoney (source) >= 1 ) then takePlayerMoney(source, 1) else outputChatBox("You Don't Have a Money", source, 255, 0, 0, true) end end addEventHandler("GIVE", getRootElement(), give) client side -- local tablee = { {"بانوراما وكاله","10000000","410"}, {"بنز وكاله","11000000","410"}, {"كمارو","9000000","410"}, {"فيراري وكاله","14000000","410"}, {"دودج تشارجر","11500000","410"}, {"لامبورجيني","15000000","410"}, } ------------------------------------------------------ GUIEditor = { progressbar = {}, label = {}, memo = {} } Deleted * ------------------------------------------------------- local Money1 = getPlayerMoney (source) local player = getLocalPlayer() addEventHandler("onClientGUIClick",root, function() local row, col = guiGridListGetSelectedItem ( grd ) local FLOS = tostring ( guiGridListGetItemText(grd,row,2 )) local cars = tostring ( guiGridListGetItemText(grd,row,1 )) local ID = tostring ( guiGridListGetItemText(grd,row,3 )) if ( source == btn ) then triggerServerEvent("GIVE",localPlayer) local RaceVehicle = createVehicle ( ID, x, y, z ) warpPedIntoVehicle ( player, RaceVehicle ) outputChatBox("تم شراء السياره بنجاح", source, 0, 255, 0, true) end end ) addEventHandler("onClientGUIClick", root, function() if ( source == X ) then guiSetVisible (wnd, false) showCursor (false) guiSetInputEnabled(false) end end ) function Show () getVisible = guiGetVisible (wnd) if (getVisible == true) then guiSetVisible (wnd, false) showCursor (false) guiSetInputEnabled(false) end if (getVisible == false) then showCursor (true) guiSetVisible( wnd, true ) end end bindKey("F2","down",Show) ابعرف بس وين المشكله واصلحه الديبوق مايقول شيء ولما اضغط على اي row يطلع الفنكشن ذا outputChatBox("You Don't Have a Money", source, 255, 0, 0, true) ويوم اضغط على الزر حتى لو ماحددت الرو يجي الفنكشن هذا outputChatBox("تم شراء السياره بنجاح", source, 0, 255, 0, true) Link to comment
Max+ Posted July 20, 2014 Share Posted July 20, 2014 --سيرفر addEvent("GIVE", true) addEventHandler("GIVE", root, function ( ) if ( getPlayerMoney (source) >= 1 ) then takePlayerMoney(source, 1) local RaceVehicle = createVehicle ( ID, x, y, z ) warpPedIntoVehicle ( source, RaceVehicle ) outputChatBox("تم شراء السياره بنجاح", source, 0, 255, 0, true) else outputChatBox("You Don't Have a Money", source, 255, 0, 0, true) end end ) --- كلينت local tablee = { {"بانوراما وكاله","10000000","410"}, {"بنز وكاله","11000000","410"}, {"كمارو","9000000","410"}, {"فيراري وكاله","14000000","410"}, {"دودج تشارجر","11500000","410"}, {"لامبورجيني","15000000","410"}, } ------------------------------------------------------ GUIEditor = { progressbar = {}, label = {}, memo = {} } ------------------------------------------------------- addEventHandler("onClientGUIClick",resourceRoot, function() if ( source == btn ) then local row, col = guiGridListGetSelectedItem ( grd ) local FLOS = tostring ( guiGridListGetItemText(grd,row,2 )) local cars = tostring ( guiGridListGetItemText(grd,row,1 )) local ID = tostring ( guiGridListGetItemText(grd,row,3 )) triggerServerEvent("GIVE",localPlayer) end end ) addEventHandler("onClientGUIClick", resourceRoot, function() if ( source == X ) then guiSetVisible (wnd, false) showCursor (false) guiSetInputEnabled(false) end end ) function Show () getVisible = guiGetVisible (wnd) if (getVisible == true) then guiSetVisible (wnd, false) showCursor (false) guiSetInputEnabled(false) end if (getVisible == false) then showCursor (true) guiSetVisible( wnd, true ) end end bindKey("F2","down",Show) Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 WARNING: M3\M33.lua:6: Bad argument @ 'createVehicle' [Expected number at argument 1, got nil] WARNING: M3\M33.lua:7: Bad argument @ 'warpPedIntoVehicle' << فيس ناشب لكم Link to comment
Max+ Posted July 20, 2014 Share Posted July 20, 2014 WARNING: M3\M33.lua:6: Bad argument @ 'createVehicle' [Expected number at argument 1, got nil] WARNING: M3\M33.lua:7: Bad argument @ 'warpPedIntoVehicle' << فيس ناشب لكم اكيد لانك ماحطيت ايدي السيارة واحداثيات النزول ID, x, y, z ... Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 الايدي في التيبل @_@ كيف اخلي الايدي يكون الي في التيبل ؟ Link to comment
Max+ Posted July 20, 2014 Share Posted July 20, 2014 الايدي في التيبل @_@كيف اخلي الايدي يكون الي في التيبل ؟ والله بالتيبل مالي خبرة فيهم . . انتظر زاحف يضبط لك وضع السيارة + لازم تعطيه الكود كامل لان حقك ناقص . . + التيبل اللي عندك كلها ستيرنق ماتوقع يضبط لازم تكون ايديات " ارقام " بدون اقواس .. Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 مشكور ي ماكس ماقـصرت والله Link to comment
Max+ Posted July 20, 2014 Share Posted July 20, 2014 مشكور ي ماكس ماقـصرت والله حياك يابعدي بالنسبة للازار صلحتها لك والسيرفر تمام بس يبي لك تسوي تيبل بالسيرفر ذي كلم فيها زاحف حياك الله # Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 اوكيشن انا بكلمه إن شاء الله , Link to comment
</Mr.Tn6eL> Posted July 20, 2014 Share Posted July 20, 2014 local row = guiGridListGetSelectedItem(grd) local id = guiGridListGetItemText(grd, row, 3) triggerServerEvent("GIVE", localPlayer, tonumber(id)) Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 تَم الإصلاح مشكورين الإخوان ماكس و تنطيل ----------------- # في الترايقر سويت كذا triggerServerEvent("GIVE", localPlayer, tonumber(id), tonumber(FLOS)) عشان ابيها تكون معرفه في السيرفر ! لكن لما احط بالسيرفر كذا if FLOS >= getPlayerMoney (source) then يجيني في الديبوق الخطأ في السطر هذا الي فوق ^ Link to comment
hassan.k.s.a Posted July 20, 2014 Share Posted July 20, 2014 (edited) ............ Edited August 1, 2014 by Guest Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 local tablee = { {"بانوراما وكاله","10000000","410"}, {"بنز وكاله","11000000","410"}, {"كمارو","9000000","410"}, {"فيراري وكاله","14000000","410"}, {"دودج تشارجر","11500000","410"}, {"لامبورجيني","15000000","410"}, } GUIEditor = { progressbar = { }, label = { }, memo = { } } addEventHandler( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn ) then if ( guiGridListGetSelectedItem ( grd ) ~= -1 ) then local Money = guiGridListGetItemText ( grd, guiGridListGetSelectedItem ( grd ), 2 ) local ID = guiGridListGetItemText ( grd, guiGridListGetSelectedItem ( grd ), 3 ) triggerServerEvent( "GIVE", localPlayer, Money, ID ) end elseif ( source == X ) then guiSetVisible ( wnd, false ) showCursor ( guiGetVisible( wnd ) ) end end ) bindKey ( "F2", "down", function ( ) guiSetVisible ( wnd, not guiGetVisible( wnd ) ) showCursor ( guiGetVisible( wnd ) ) end ) local vehicle = { }; addEvent( "GIVE", true ) addEventHandler( "GIVE", root, function ( Money, ID ) if ( Money and ID ) then if ( getPlayerMoney ( source ) >= tonumber ( Money ) ) then if ( isElement ( vehicle[ source ] ) ) then destroyElement ( vehicle[ source ] ) end local x, y, z = getElementPosition ( source ) vehicle[ source ] = createVehicle ( tonumber( ID ), x, y, z ) if ( vehicle[ source ] ) then warpPedIntoVehicle ( source, vehicle[ source ] ) outputChatBox( "* تم الشراء بنجاح #", source, 0, 255, 0, true ) takePlayerMoney ( source, tonumber ( Money ) ) end else outputChatBox( "* "..tonumber ( Money ).." سعر هذهـ السيارة #", source, 0, 255, 0, true ) end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( vehicle[ source ] ) ) then destroyElement ( vehicle[ source ] ) vehicle[ source ] = nil end end ) addEventHandler( "onVehicleExplode", resourceRoot, function ( ) setTimer( destroyElement, 3000, 1, source ) end ) Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 الكود شغلته تمام واحسبه ضبط يوم حطيت الديبوق طلع الخطأ M33.lua:9: Bad argument @ 'createVehicle' [Expected number at argument 1, got nil] حاولت اعدله وحطيت احاداثيات لكن ماش : ( Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 غريب ... القيمة تجي نل طيب ورنا يوم تضيف الكولمنز للـست Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 wnd = guiCreateWindow(267, 161, 319, 438, "Buy Car's System", false) guiWindowSetSizable(wnd, false) guiSetVisible( wnd, false ) guiWindowSetMovable( wnd, false ) guiSetProperty(wnd, "CaptionColour", "FFB1F006") grd = guiCreateGridList(9, 24, 177, 404, false, wnd) guiGridListAddColumn(grd, "#", 0.5) guiGridListAddColumn(grd, "Money", 0.5) Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 اقصد ورني يوم تحط الرو للكولمن Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 الكود نفسه ؟ انا مسوي هذي for k,v in ipairs ( tablee ) do row = guiGridListAddRow(grd) guiGridListSetItemText(grd,row,1,v[1],false,false) guiGridListSetItemText(grd,row,2,v[2],false,false) عشان يجيب الاسم الي في التيبل للمعلوميه ^^ انا ماني مسوي كولمن للآيدي حق السياره بس مابيه يظهر باللوحه Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 ضيف ع الكود ذا هذا .. guiGridListSetItemData( grd, row, 1, v[3] ) واستبدل كلنت الى .. : local tablee = { {"بانوراما وكاله","10000000","410"}, {"بنز وكاله","11000000","410"}, {"كمارو","9000000","410"}, {"فيراري وكاله","14000000","410"}, {"دودج تشارجر","11500000","410"}, {"لامبورجيني","15000000","410"}, } GUIEditor = { progressbar = { }, label = { }, memo = { } } addEventHandler( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn ) then if ( guiGridListGetSelectedItem ( grd ) ~= -1 ) then local Money = guiGridListGetItemText ( grd, guiGridListGetSelectedItem ( grd ), 2 ) local ID = guiGridListGetItemData( grd, guiGridListGetSelectedItem( grd ), 1 ) triggerServerEvent( "GIVE", localPlayer, Money, ID ) end elseif ( source == X ) then guiSetVisible ( wnd, false ) showCursor ( guiGetVisible( wnd ) ) end end ) bindKey ( "F2", "down", function ( ) guiSetVisible ( wnd, not guiGetVisible( wnd ) ) showCursor ( guiGetVisible( wnd ) ) end ) Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 Thank'sss مشكورين الجميع وخصوصا ماكس وزاحف تم الإصلاح , 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