Jump to content

XboxMS

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by XboxMS

  1. الله يبارك فيك اخي الكود اللي عطتهلي ما اشتغل بشكل كامل لكن استفدت من المثال في function showPlayerMoney(thePlayer, command, playerName) local result = executeSQLQuery("SELECT money FROM players WHERE name=?", playerName) if(#result == 0) then outputConsole("No player named " .. playerName .. " is registered.", thePlayer) else outputConsole("Money amount of player " .. playerName .. " is " .. result[1].money, thePlayer) end end addCommandHandler("playermoney", showPlayerMoney) في executeSQLQuery
  2. ابي كود او طريقة معينة تتحقق ان الرو موجود او لا في الكوليمن متلا لوكان عندي كوليمن اسمه playerName وابي اتاكد ان اسم اللاعب موجود او لا في الكولمين حتى ارسله رسالة في الشات تقوله ان اسمه موجود جربت الكود هدا : local database = dbConnect("sqlite","Player.db") function createTables() dbQuery(database,"CREATE TABLE IF NOT EXISTS players (playerName TEXT) ") end addEventHandler("onResourceStart",resourceRoot,createTables) function isPlayerNameExists(thePlayer) local isExists = dbQuery(database,"SELECT playerName FROM players") local result = dbPoll(isExists,-1) if result then for _,row in pairs(result) do for column, value in pairs ( row ) do if value == getPlayerName(thePlayer) then return false else return true end end end end end function addPlayerToDatabase () if isPlayerNameExists(source) == true then dbQuery(database,"INSERT INTO players (playerName) VALUES(?)",getPlayerName(source)) outputChatBox("You have added to the players database",source) elseif isPlayerNameExists(source) == false then outputChatBox("You're already in the column",source,255,0,0) else outputChatBox("another issues") end end
  3. i fixed the problem and it work now anyone maybe need it local rotationZ = -getPedCameraRotation(localPlayer)-vehr
  4. Hi i have a problem when i attach my custom object with a custom vehicle to make 14.5mm machine gun script every thing worked very well and like i want but i had one problem when i used player's camera rotation to rotate the object like i know when i rotate the attached element it rotates in ToAttachedElement's space not the world space the problem is the rotation at z axis which means it will rotate successfully only if the vehicle's z rotation is 0 i think the picture and the code will explain more function updateWeaponAndObj (_,_,_,_,worldx,worldy,worldz) -- added by another function ( "onClientCursorMove" ) local x,y,z = getElementPosition(weaponsobj)--the object local veh = getWeaponVehicle() -- it's get the vehicle by data local _,_,vehr = getElementRotation(veh) local rotationY = 0 local rotationZ = -getPedCameraRotation(localPlayer) local rotationX = (getCameraRotation ())+270 -- +270 because there is a problem with the custom object model file setElementAttachedOffsets(weaponsobj,0,-2.26,1.1, rotationX,rotationY,rotationZ) local _,_,rotz = getElementRotation(weaponsobj)-- i use it to rotate the player in the serverside triggerServerEvent("onClientMoveWeaponWe",localPlayer,rotz,x,y,z,rotationX,rotationY,rotationZ,worldx,worldy,worldz) end if there is any way to calculate the z rotation of the object in world space please help sorry for my bad English
  5. اكيد مشفر لكن اساس المود واضح في نظري
  6. عارف انه لمن قام بالحدت لكن اكيد في طريقة https://community.multitheftauto.com/in ... ls&id=5711 و حتى في الشوتر FFS
  7. ياتر على ظهوره للاخرين؟ ما اعتقد لانه فنكشن يصلح للاتنين
  8. السلام عليكم معي مشكلة في الاسلحة سويت سكربت يخلي سلاح ملتصق في سيارة ويطلق بزر و يوقف و قائمة شراء دخيره وكل شي تمام لكن هدا كله بدون تجربه مع واحد غيري المشكلة عندي ان السلاح ما يطلع لغيري ولا يأثر فيهم ولا شي يعني كيف اسويه يطلع للكل هو و الاصوات او اي فنكشن مثل setVehicleComponentRotation بحثث بالمنتدى العربي والانجليزي لقيت مثال باستخدام triggerClientEvent مع وضع السورس root لكن ما ظبط ولا غير شيء --serverside local key = "num_0" function create_car (player,seat) if getElementModel(source) == 470 and seat == 0 then local money = getPlayerMoney(player) bindKey(player,key,"down",bindMyKeys,money,source) end end addEventHandler("onVehicleEnter",root,create_car) function bindMyKeys (player,key,state,money,vehicle) if money >= 100000 then local x,y,z = getElementPosition(vehicle) weap_blib = createBlipAttachedTo(vehicle,0,4,255,0,0,255,0,99999) triggerClientEvent(player,"onBindToFire",getRootElement(),vehicle,z,y,z) triggerClientEvent(player,"onEnter",player) local mn = getPlayerMoney(player) setElementData(vehicle,"isWeaponCar",true) setElementData(vehicle,"hasPlayerWeapon",true) setPlayerMoney(player,mn-100000) unbindKey(player,key,"down",bindMyKeys) elseif money < 100000 then outputChatBox("money",player,255,0,0) end end . --clientside function CreateWeapon_c (vehicle,x,y,z) weapon = createWeapon("minigun",x,y,z) setWeaponAmmo(weapon,3000) setWeaponProperty(weapon, "fire_rotation", 0,-40,0) setWeaponProperty(weapon, "damage",80) attachElements(weapon,vehicle,0,0.5,2.17,0,39,90) end ياريت لو في طريقة مجربه وتشتغل تفيدوني مشكورين مقدما
  9. مشكورين كلكم ما قصرتوا اني مازالت جديد في البرمجة الكود اشتغل اسف لو تعبتكم معاي
  10. السلام عليكم ابي كود لحدف سيارة لو خرج اللاعب من السيرفر انا سويت بداية وفيها ماركر اخد سيارة كل شي تمام بس لما يخرج اللاعب من السيرفر السيارة ماتنحدف لو ممكن تساعدوني شباب marker = createMarker(1133.0999755859 ,-1599.5999755859, 12,"cylinder",3,25,151,178,255) marker2 = createMarker(1133.0999755859 ,-1609.8000488281, 12,"cylinder",3,25,151,178,255) local vehicles = {480,411,506,522,419,559,560,550,565,562} local vehicleT = {} local spawns = { {1268.93140,-1795.98230, 13}, {1276.86926 ,-1796.88538, 13}, } function onMarkerHit(player) if ( getElementType(player) == "player" ) then if not( isPedInVehicle(player) ) then if ( isElement(cars) ) then destroyElement(cars) end local model = vehicles[math.random(#vehicles)] local x,y,z = getElementPosition(source) local rnd = math.random( 1, #spawns ) local cars = createVehicle(model,spawns[rnd][1], spawns[rnd][2],13) setElementRotation(cars,0,0,180) addVehicleUpgrade ( cars, 1010 ) addVehicleUpgrade ( cars, 1080 ) addVehicleUpgrade ( cars, 1034 ) addVehicleUpgrade ( cars, 1171 ) addVehicleUpgrade ( cars, 1087 ) addVehicleUpgrade ( cars, 1010 ) addVehicleUpgrade ( cars, 1149 ) addVehicleUpgrade ( cars, 1038 ) addVehicleUpgrade ( cars, 1041 ) addVehicleUpgrade ( cars, 1147 ) setVehiclePaintjob(cars,0) warpPedIntoVehicle ( player,cars ) setVehicleColor(cars, 200, 60, 40 ) end end end addEventHandler("onVehicleExplode",root, function() setTimer(destroyElement,2500,1,source) end ) addEventHandler("onMarkerHit",marker,onMarkerHit) addEventHandler("onMarkerHit",marker2,onMarkerHit) addEventHandler("onVehicleExplode",cars,onVehicleExplode )
  11. مشكورين كلكم ما قصرتوا تم حل المشكلة
  12. السلام عليكم شباب لو يمكن تصيح الكود هدا ما اعرف ليش ما يشتغل اني نبيه لو مات احد من عصابة SKULLS يروح للاحداتيات اللي انا حاطها ويحصل درع وشخصية 30 ملاحظة: الكود ليس من برمجتي فقط عدلته addEventHandler('onPlayerSpawn', root, function() if getTeamName(getPlayerTeam(source)) == "No Team" and getElementData(source, "gang") == "SKULLS" then setElementPosition( entered,140.40361,1370.79529,1083.86633) setElementInterior ( entered, 5 ) setElementDimension ( entered, 0 ) setElementHealth ( player, 200 ) setPedArmor ( player, 100 ) setPedSkin ( player, 30 ) end end ) لو فيه الكتير من الاخطاء آسف
  13. ﺍﺷﻜﺮﻛﻢ ﺟﻤﻴﻌﺎ ﻣﺎ ﻗﺼﺮﺗﻮﺍ ﻓﻲ ﺍﻟﻤﺴﺎﻋﺪﻩ ﻟﻜﻦ ﺍﻟﻮﻳﻨﺪﻭﺯ ﺑﺘﺎﻋﻲ ﺻﺎﺭ ﻓﻴﻪ ﺧﻠﻞ ﻭﺣﺎﻟﻴﺎ ﻗﺎﻋﺪ ﻋﻨﺪ ﺍﻟﺼﻠﺎﺡ ﻭﺭﺡ ﻳﺴﻮﻳﻠﻪ ﻓﻮﺭﻣﺎﺕ ﻳﻌﻨﻲ ﺿﺎﻉ ﻣﻠﻒ ﺍﻟﺴﻴﺎﺭﻩ ﺍﻋﺘﺪﺭ ﻟﻜﻢ ﺟﻤﻴﻌﺎ ﻣﺎ ﺍﻋﺮﻑ ﻛﻴﻒ ﺍﺻﻠﺢ ﺍﻟﺨﻂﺎ ﺍﻟﺮﺟﺎﺀ ﺍﻏﻠﺎﻕ ﺍﻟﻤﻮﺿﻮﻉ ﻣﻦ ﺍﻟﻤﺸﺮﻓﻴﻦ ﺍﺳﻒ ﺍﺳﻒ ﺍﺳﻒ ﻟﻮ ﺗﻤﻜﻨﺖ ﻣﻦ ﺍﺳﺘﻌﺎﺩﻩ ﺍﻟﻤﻠﻒ ﺭﺡ اﺴﻮﻱ ﺍﻟﻠﻲ ﻗﻠﺘﻮﻩ ﺍﺷﻜﺮﻛﻢ ﺍﺳﻔﻲ ﺍﻟﺸﺪﻳﺪ
  14. الفكرة ليست مستحيله ، بالنسبه لو بيدك قنابل و صواريخ و غيره createProjectile أما لل سلاح فهو ليس مستحيل ، أنا بشوفلك شكرا لك الشرح سهل وفهمته ورح ابدأ في تعلم برمجة lua
  15. السلاح اصلا في اوبحكت منفصل
  16. السلام عليكم يا شباب انا عندي فكرة يمكن تكون الاولى من نوعها هنا وبما اني ما افهم شي في البرمجة حبيت استفسر منكم هل يمكن فعلها ام لا الفكرة عبارة عن اطلاق رصاص من سلاح دوشكا على سيارة عدلتها. فهل هدا الشيء ممكن ام انسى الفكرة من اساسها صورة للسيارة هدا اول موضع لي في المنتدى لو خالفت القانون اعتدر على دلك سلام
×
×
  • Create New...