Doffy Posted May 10, 2017 Share Posted May 10, 2017 (edited) بدي اول ما الواحد يختار من الجدول الي قدامك في الجريد ليست ينتقل للواحد وينسحب منه الفلوس الي هي في اخر الجدول واذا الواحد ما معه فلوس كافية يقولك لا يمكنك الانتقال انت لا تملك المال الكافي محاولتي ما اشتغلت كلنت Place = { {"البداية",214.04817199707,1863.1745605469,13.229927062988,"5000"}, {"محل الاسلحة",184.12344,1930.58215,17.83168,"500"}, {"المطعم",131.03760,1843.88623,17.64063,"750"}, {"مدينة الزومبي",610.85944,856.56067,-42.96094,"2500"}, {"الحي السكني",2566.57617,1823.58655,10.82031,"6000"}, {"ساحة الزومبي",2926.33032,-495.73251,8.45146,"3500"}, {"البنك",1480.97046,-1762.51636,18.79576,"1000"}, {"المطار الاول",1717.6470947266, -2494.1176757813, 13.39999961853,"4500"}, {"المطار الثاني",-1223.4300537109, -185.74758911133, 14.39999961853,"3000"}, {"المطار الثالث",1411.7646484375, 1482.3529052734, 10.89999961853,"1500"}, {"المزرعة",-1095.40076,-991.21289,129.21875,"8000"}, {"الوحش العملاق",-2323.83716,-1639.74756,483.70313,"20000"}, } for i,k in ipairs (Place) do l = guiGridListAddRow (placelist) guiGridListSetItemText (placelist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (placelist,l,2,tostring(k[5]),false,false) guiGridListSetItemData(placelist,l,1,{k[2],k[3],k[4]}) guiGridListSetItemData (placelist,l,1,k[1]) guiGridListSetItemColor(placelist,l,1,255,0,255) guiGridListSetItemColor(placelist,l,2,0,255,0) guiSetFont(placelist,"default-bold-small") end addEventHandler("onClientGUIClick",warp, function () local sel = guiGridListGetSelectedItem(placelist) if sel ~= -1 then local x, y, z = (guiGridListGetItemData(placelist,sel,1)) local money = (guiGridListGetItemData(placelist,sel,5)) takePlayerMoney(money) outputChatBox("[Places] تم نقلك",54, 0, 224) fadeCamera ( false ) setTimer ( fadeCamera, 1500, 1, true ) setTimer ( setElementPosition, 1200, 1, localPlayer, x, y, z ) end end ,false) Edited May 10, 2017 by KinG_Himoo12 Link to comment
iMr.WiFi..! Posted May 10, 2017 Share Posted May 10, 2017 (edited) for i,k in ipairs (Place) do l = guiGridListAddRow (placelist) guiGridListSetItemText (placelist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (placelist,l,2,tostring(k[5]),false,false) guiGridListSetItemData(placelist,l,1,{k[2],k[3],k[4],k[1]}) guiGridListSetItemColor(placelist,l,1,255,0,255) guiGridListSetItemColor(placelist,l,2,0,255,0) guiSetFont(placelist,"default-bold-small") end addEventHandler("onClientGUIClick",warp, function () local sel = guiGridListGetSelectedItem(placelist) if sel ~= -1 then local data = guiGridListGetItemData(placelist,sel,1) triggerServerEvent ( 'Warp', localPlayer, data[1],data[2],data[3],data[4] ) end end ,false) -- Server addEvent ( 'Warp', true ) addEventHandler ( 'Warp', root, function ( x,y,z,money ) if getPlayerMoney ( source ) < money then return outputChatBox('ليس لديك المال الكافي') end setElementPosition ( source, x, y, z ) takePlayerMoney ( source, money ) outputChatBox('تم نقلك') end ) Edited May 10, 2017 by iMr.WiFi..! Delete Position Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 (edited) On 10/05/2017 at 09:21, iMr.WiFi..! said: for i,k in ipairs (Place) do l = guiGridListAddRow (placelist) guiGridListSetItemText (placelist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (placelist,l,2,tostring(k[5]),false,false) guiGridListSetItemData(placelist,l,1,{k[2],k[3],k[4],k[1]}) guiGridListSetItemColor(placelist,l,1,255,0,255) guiGridListSetItemColor(placelist,l,2,0,255,0) guiSetFont(placelist,"default-bold-small") end addEventHandler("onClientGUIClick",warp, function () local sel = guiGridListGetSelectedItem(placelist) if sel ~= -1 then local data = guiGridListGetItemData(placelist,sel,1) triggerServerEvent ( 'Warp', localPlayer, data[1],data[2],data[3],data[4] ) end end ,false) -- Server addEvent ( 'Warp', true ) addEventHandler ( 'Warp', root, function ( x,y,z,money ) if getPlayerMoney ( source ) < money then return outputChatBox('ليس لديك المال الكافي') end setElementPosition ( source, x, y, z ) takePlayerMoney ( source, money ) outputChatBox('تم نقلك') end ) Expand موب شغال الدي بق ERROR:Warp\s.lua:4 attempt to compare number with string Edited May 10, 2017 by KinG_Himoo12 Link to comment
iMr.WiFi..! Posted May 10, 2017 Share Posted May 10, 2017 for i,k in ipairs (Place) do l = guiGridListAddRow (placelist) guiGridListSetItemText (placelist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (placelist,l,2,tostring(k[5]),false,false) guiGridListSetItemData(placelist,l,1,{k[2],k[3],k[4],k[1]}) guiGridListSetItemColor(placelist,l,1,255,0,255) guiGridListSetItemColor(placelist,l,2,0,255,0) guiSetFont(placelist,"default-bold-small") end addEventHandler("onClientGUIClick",warp, function () local sel = guiGridListGetSelectedItem(placelist) if sel ~= -1 then local data = guiGridListGetItemData(placelist,sel,1) triggerServerEvent ( 'Warp', localPlayer, data[1],data[2],data[3],data[4] ) end end ,false) -- Server addEvent ( 'Warp', true ) addEventHandler ( 'Warp', root, function ( x,y,z,money ) if getPlayerMoney ( source ) < tonumber(money) then return outputChatBox('ليس لديك المال الكافي') end setElementPosition ( source, x, y, z ) takePlayerMoney ( source, tonumber(money) ) outputChatBox('تم نقلك') end ) Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 On 10/05/2017 at 09:32, iMr.WiFi..! said: for i,k in ipairs (Place) do l = guiGridListAddRow (placelist) guiGridListSetItemText (placelist,l,1,tostring(k[1]),false,false) guiGridListSetItemText (placelist,l,2,tostring(k[5]),false,false) guiGridListSetItemData(placelist,l,1,{k[2],k[3],k[4],k[1]}) guiGridListSetItemColor(placelist,l,1,255,0,255) guiGridListSetItemColor(placelist,l,2,0,255,0) guiSetFont(placelist,"default-bold-small") end addEventHandler("onClientGUIClick",warp, function () local sel = guiGridListGetSelectedItem(placelist) if sel ~= -1 then local data = guiGridListGetItemData(placelist,sel,1) triggerServerEvent ( 'Warp', localPlayer, data[1],data[2],data[3],data[4] ) end end ,false) -- Server addEvent ( 'Warp', true ) addEventHandler ( 'Warp', root, function ( x,y,z,money ) if getPlayerMoney ( source ) < tonumber(money) then return outputChatBox('ليس لديك المال الكافي') end setElementPosition ( source, x, y, z ) takePlayerMoney ( source, tonumber(money) ) outputChatBox('تم نقلك') end ) Expand برضو موب شغال الدي بق ERROR:Warp\s.lua:4: attempt to compare number with nill Link to comment
iMr.WiFi..! Posted May 10, 2017 Share Posted May 10, 2017 Place = { {"البداية",214.04817199707,1863.1745605469,13.229927062988,5000}, {"محل الاسلحة",184.12344,1930.58215,17.83168,500}, {"المطعم",131.03760,1843.88623,17.64063,750}, {"مدينة الزومبي",610.85944,856.56067,-42.96094,2500}, {"الحي السكني",2566.57617,1823.58655,10.82031,6000}, {"ساحة الزومبي",2926.33032,-495.73251,8.45146,3500}, {"البنك",1480.97046,-1762.51636,18.79576,1000}, {"المطار الاول",1717.6470947266, -2494.1176757813, 13.39999961853,4500}, {"المطار الثاني",-1223.4300537109, -185.74758911133, 14.39999961853,3000}, {"المطار الثالث",1411.7646484375, 1482.3529052734, 10.89999961853,1500}, {"المزرعة",-1095.40076,-991.21289,129.21875,8000}, {"الوحش العملاق",-2323.83716,-1639.74756,483.70313,20000}, } ^ بدل الجدول بهذا واستعمل الكود الي قبل Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 On 10/05/2017 at 10:07, iMr.WiFi..! said: Place = { {"البداية",214.04817199707,1863.1745605469,13.229927062988,5000}, {"محل الاسلحة",184.12344,1930.58215,17.83168,500}, {"المطعم",131.03760,1843.88623,17.64063,750}, {"مدينة الزومبي",610.85944,856.56067,-42.96094,2500}, {"الحي السكني",2566.57617,1823.58655,10.82031,6000}, {"ساحة الزومبي",2926.33032,-495.73251,8.45146,3500}, {"البنك",1480.97046,-1762.51636,18.79576,1000}, {"المطار الاول",1717.6470947266, -2494.1176757813, 13.39999961853,4500}, {"المطار الثاني",-1223.4300537109, -185.74758911133, 14.39999961853,3000}, {"المطار الثالث",1411.7646484375, 1482.3529052734, 10.89999961853,1500}, {"المزرعة",-1095.40076,-991.21289,129.21875,8000}, {"الوحش العملاق",-2323.83716,-1639.74756,483.70313,20000},} ^ بدل الجدول بهذا واستعمل الكود الي قبل Expand برضو تيجي نفس المشكلة ذي ERROR:Warp\s.lua:4: attempt to compare number with nill Link to comment
' A F . Posted May 10, 2017 Share Posted May 10, 2017 addEvent ( "Warp" , true ) addEventHandler ( "Warp" , root , function ( posX , posY , posZ , aMoney ) local aPlayerMoney = getPlayerMoney ( source ); if ( tonumber ( aPlayerMoney ) >= tonumber ( aMoney ) ) then takePlayerMoney ( source , tonumber ( aMoney ) ); setElementPosition ( source , posX , posY , posZ ); outputChatBox ( "* Warped",source,0,255,0,true); else outputChatBox("* You Don't Have Money ",source,255,0,0,true); end end ); Try This Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 On 10/05/2017 at 17:00, Default said: addEvent ( "Warp" , true )addEventHandler ( "Warp" , root , function ( posX , posY , posZ , aMoney )local aPlayerMoney = getPlayerMoney ( source );if ( tonumber ( aPlayerMoney ) >= tonumber ( aMoney ) ) then takePlayerMoney ( source , tonumber ( aMoney ) );setElementPosition ( source , posX , posY , posZ );outputChatBox ( "* Warped",source,0,255,0,true);elseoutputChatBox("* You Don't Have Money ",source,255,0,0,true);endend ); Try This Expand موب شغال دي بق ERROR: Warp\s.lua:4: attempt to compare nil with number Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 On 10/05/2017 at 17:31, Default said: اطرح الكلنت والسيرفر كامل Expand طرحتهم فوق كذا بطرحهم معي اللوحة Link to comment
' A F . Posted May 10, 2017 Share Posted May 10, 2017 طيب انا أقولك اطرحهم كلهم عشان بجربهم بالمحلي وأصحح الاخطاء اذا ماتبي ذا شيء رأجع لك . Link to comment
Doffy Posted May 10, 2017 Author Share Posted May 10, 2017 On 10/05/2017 at 17:35, Default said: طيب انا أقولك اطرحهم كلهم عشان بجربهم بالمحلي وأصحح الاخطاء اذا ماتبي ذا شيء رأجع لك . Expand طيب تعال بلخاص 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