Jump to content

فاّرس

Members
  • Posts

    4,805
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by فاّرس

  1. markers = { {2508.953125,-1672.2054443359,13.381790161133}, {2497.9853515625,-1672.5334472656,13.34220790863}, {2495.8220214844,-1682.44921875,13.347380638123} } addEventHandler('onResourceStart',resourceRoot,function() for k,v in ipairs(markers) do createMarker(v[1],v[2],v[3],'cylinder',3,255,255,175,170) end end ) local vehicles = {} addEvent('CreVehicePv',true) addEventHandler('CreVehicePv', root , function(id) local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 2, y, z) warpPedIntoVehicle(source, vehicles[source]) end ) addEventHandler('onPlayerQuit', root,function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end ) addEventHandler('onMarkerHit',resourceRoot,function(hitPlayer) if getElementType(hitPlayer) == 'player' then triggerClientEvent ('showGUIpv',root) end end )
  2. ^ تسوي كذا مشوار , جرب سوي كذا, markers = { {x,y,z}, {x,y,z}, {x,y,z} } addEventHandler('onResourceStart',resourceRoot,function() for k,v in ipairs(markers) do marker = createMarker(v[1],v[2],v[3],'cylinder',3,255,255,175,170) end end )
  3. سوي جدول ماركرات واستخدم لوب واذا لمس اي ماركر اكيد تنزل سياره وحده ,
  4. اكيد تقدر , لو تلاحظ في ارقومنتات للاتجاه, vehicle createVehicle ( int model, float x, float y, float z [, float rx, float ry, float rz, string numberplate, bool bDirection, int variant1, int variant2 ] ) rx,ry,rz < حق الاتجاه ذذ
  5. local markerpv = createMarker( 1566.9652099609, -1610.640625, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) local vehicles = {} function spawnVehp(id) local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 2, y, z) warpPedIntoVehicle(source, vehicles[source]) end addEvent("CreVehicePv",true) addEventHandler("CreVehicePv", root, spawnVehp) addEventHandler("onPlayerQuit", root,function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end ) function showGUIpv(hitPlayer) if getElementType(hitPlayer) == "player" then triggerClientEvent ("showGUIpv",root) end end addEventHandler("onMarkerHit",markerpv,showGUIpv) تبي النافذه للكل ولا للي لمس الماركر؟ اذا للي لمس الماركر حط الكود كلنت وريح نفسك احسن من تريقر وشغله ذذ ^ الكود اذا لمست الماركر تنفتح اللوحه للكل ,
  6. والي ما فهم وش تبي ؟ وما تخش العقل الكود بكبره الي سواه ما يقدر يعدله؟ ._. , الا اذا مزروف هذي مشكله ثانيه
  7. 'localPlayer' is already defined by default mta.
  8. ZA7F هو متغير الصوت تبي تغيره ولا بكيفك ذذ
  9. وتوي ادري انه يطلع خطأ مشكور onPlayerSpawn انا ما ادري متى يبيه بالضبط فـ حطيت
  10. ElementPosition = { [1] = {x,y,z}, [2] = {x,y,z}, [3] = {x,y,z}, [4] = {x,y,z} } addEventHandler('onPlayerSpawn',root,function() if getElementModel(source) == id then local x,y,z = unpack(ElementPosition[math.random(#ElementPosition)]) spawnPlayer(source,x,y,z) end end ) * x,y,z = غيرها للإحداثيات, مثآل, ElementPosition = { [1] = {1422,1721,18371}, [2] = {x,y,z}, [3] = {x,y,z}, [4] = {x,y,z} } كمل الباقي ذذ * id = اي دي الشخصيه الي تبيها ما قلت لنا متى تبيه يسوي سباون؟ تبيه يوم يموت ولا يوم يسوي سباون بعد ما يدخل ولا متى ؟ انا سويته لك بعد ما يسوي سباون
  11. عدل x,y,z بالاحداثيات الي تبيها, Play وبكيفك تبيه مود جديد ولا حطه مع
  12. عدل الي فوق , ضيفها في نفس الملف تحت
  13. ما ادري اذا عندك الفري روم الاصلي الي مو معدل , ولكن التعديل يكون في الوظيفه حق السياره , fr_client.lua : Create vehicle window سطر 926 بعد الوظيفه انزل سطر وحط هذا الكود local vehicleWidth = { [400] = 3.03, [401] = 3.30, [402] = 2.90, [403] = 5.30, [404] = 3.21, [405] = 3.37, [406] = 6.60, [407] = 4.89, [408] = 5.90, [409] = 4.36, [410] = 2.89, [411] = 2.69, [412] = 3.97, [413] = 3.34, [414] = 3.99, [415] = 3.04, [416] = 4.42, [417] = 16.01, [418] = 3.32, [419] = 3.45, [420] = 3.30, [421] = 3.53, [422] = 3.11, [423] = 3.60, [424] = 2.44, [425] = 9.84, [426] = 3.29, [427] = 4.48, [428] = 3.73, [429] = 2.91, [430] = 6.59, [431] = 6.66, [432] = 7.17, [433] = 5.51, [434] = 2.69, [435] = 7.33, [436] = 3.11, [437] = 6.40, [438] = 3.37, [439] = 3.04, [440] = 3.29, [441] = 2.00, [442] = 3.71, [443] = 10.38, [444] = 3.85, [445] = 3.30, [446] = 6.73, [447] = 7.58, [448] = 1.33, [449] = 5.29, [450] = 7.17, [451] = 3.06, [452] = 5.92, [453] = 6.02, [454] = 9.70, [455] = 5.35, [456] = 5.18, [457] = 2.10, [458] = 3.44, [459] = 3.27, [460] = 8.94, [461] = 1.44, [462] = 1.33, [463] = 1.40, [464] = 1.25, [465] = 0.94, [466] = 3.45, [467] = 3.53, [468] = 1.39, [469] = 7.58, [470] = 3.24, [471] = 1.49, [472] = 4.58, [473] = 2.61, [474] = 3.37, [475] = 3.26, [476] = 8.19, [477] = 3.36, [478] = 3.23, [479] = 3.39, [480] = 2.83, [481] = 1.17, [482] = 3.33, [483] = 3.44, [484] = 9.92, [485] = 2.37, [486] = 4.67, [487] = 7.71, [488] = 6.53, [489] = 3.38, [490] = 3.93, [491] = 3.00, [492] = 2.84, [493] = 6.79, [494] = 3.57, [495] = 3.22, [496] = 2.65, [497] = 7.71, [498] = 4.19, [499] = 3.99, [500] = 2.90, [501] = 0.94, [502] = 3.35, [503] = 3.40, [504] = 3.39, [505] = 3.38, [506] = 2.94, [507] = 3.60, [508] = 4.62, [509] = 1.21, [510] = 1.13, [511] = 15.03, [512] = 6.58, [513] = 6.51, [514] = 5.55, [515] = 5.68, [516] = 3.49, [517] = 3.51, [518] = 3.33, [519] = 13.87, [520] = 8.61, [521] = 1.44, [522] = 1.44, [523] = 1.44, [524] = 5.08, [525] = 3.94, [526] = 2.98, [527] = 3.14, [528] = 3.28, [529] = 3.15, [530] = 2.63, [531] = 2.31, [532] = 7.38, [533] = 2.53, [534] = 3.40, [535] = 3.15, [536] = 3.54, [537] = 11.06, [538] = 8.26, [539] = 2.61, [540] = 3.44, [541] = 2.79, [542] = 3.53, [543] = 3.24, [544] = 6.73, [545] = 2.80, [546] = 3.30, [547] = 3.28, [548] = 12.72, [549] = 3.14, [550] = 3.34, [551] = 2.86, [552] = 4.02, [553] = 18.92, [554] = 3.57, [555] = 2.84, [556] = 3.85, [557] = 3.85, [558] = 2.94, [559] = 3.05, [560] = 3.05, [561] = 3.28, [562] = 2.98, [563] = 9.65, [564] = 0.93, [565] = 2.72, [566] = 3.58, [567] = 3.71, [568] = 2.75, [569] = 9.41, [570] = 9.41, [571] = 1.61, [572] = 1.75, [573] = 4.15, [574] = 2.43, [575] = 3.26, [576] = 3.48, [577] = 45.08, [578] = 6.35, [579] = 3.31, [580] = 3.35, [581] = 1.46, [582] = 3.98, [583] = 2.52, [584] = 8.24, [585] = 3.56, [586] = 1.56, [587] = 3.24, [588] = 5.52, [589] = 2.98, [590] = 9.67, [591] = 7.38, [592] = 36.34, [593] = 9.36, [594] = 0.58, [595] = 6.34, [596] = 3.30, [597] = 3.31, [598] = 3.25, [599] = 3.57, [600] = 3.35, [601] = 4.56, [602] = 3.14, [603] = 3.38, [604] = 3.45, [605] = 3.24, [606] = 2.46, [607] = 2.43, [608] = 4.01, [609] = 4.17, [610] = 1.59, [611] = 2.11, } addEvent('Checks',true) addEventHandler('Checks',root,function(vx,vy,vz,vehID,vrot) if tonumber(vx and vy and vz and vehID and vrot) then local px,py,pz = getElementPosition(g_Me) local width = vehicleWidth[vehID] or 3 if isLineOfSightClear(px,py,pz+1,vx+width,vy+width,vz+1) and isLineOfSightClear(px,py,pz+1,vx+width,vy-width,vz+1) and isLineOfSightClear(px,py,pz+1,vx-width,vy-width,vz+1) and isLineOfSightClear(px,py,pz+1,vx-width,vy+width,vz+1) then triggerServerEvent('SendAndGiveVeh',g_Me,vx,vy,vz,vehID,vrot) else errMsg('Please find a clear location to spawn the vehicle.') end end end ) fr_server.lua : وفي ملف من سطر 297 الى 348 امسحها كلها , وبدلها بهذا, function giveMeVehicles(vehicles) if type(vehicles) == 'number' then vehicles = { vehicles } end local px, py, pz, prot local radius = 3 local playerVehicle = getPedOccupiedVehicle(source) if playerVehicle and isElement(playerVehicle) then px, py, pz = getElementPosition(playerVehicle) prot, prot, prot = getVehicleRotation(playerVehicle) else px, py, pz = getElementPosition(source) prot = getPedRotation(source) end local offsetRot = math.rad(prot) local vx = px + radius * math.cos(offsetRot) local vy = py + radius * math.sin(offsetRot) local vz = pz + 2 local vrot = prot vehicleList = g_PlayerData[source].vehicles local vehicle if ( not vehicles ) then return end for i,vehID in ipairs(vehicles) do if vehID < 400 or vehID > 611 then errMsg(vehID ..' is incorrect vehicle model', source) elseif not table.find(getOption('vehicles.disallowed'), vehID) then if #vehicleList >= getOption('vehicles.maxperplayer') then unloadVehicle(vehicleList[1]) end triggerClientEvent('Checks',source,vx,vy,vz,vehID,vrot) end end end addEvent('SendAndGiveVeh',true) addEventHandler('SendAndGiveVeh',root, function(vx,vy,vz,vehID,vrot) vehicle = createVehicle(vehID, vx, vy, vz, 0, 0, vrot) if (not isElement(vehicle)) then return end setElementInterior(vehicle, getElementInterior(source)) setElementDimension(vehicle, getElementDimension(source)) table.insert(vehicleList, vehicle) g_VehicleData[vehicle] = { creator = source, timers = {} } if vehID == 464 then warpPedIntoVehicle(source, vehicle) elseif not g_Trailers[vehID] then if getOption('vehicles.idleexplode') then g_VehicleData[vehicle].timers.fire = setTimer(commitArsonOnVehicle, getOption('vehicles.maxidletime'), 1, vehicle) end g_VehicleData[vehicle].timers.destroy = setTimer(unloadVehicle, getOption('vehicles.maxidletime') + (getOption('vehicles.idleexplode') and 10000 or 0), 1, vehicle) end vx = vx + 4 vz = vz + 4 end ) واذا ما عرفت اطرح اكواد ملفات الفري روم كلنت وسيرفر, واذا كان ما تبي احد يآخذه ارسله لي خآص , Solidsnake14 او جرب كود
  14. انت تبيها عشوائي ؟ اذا عشوائي سوي جدول اسهل لك, واذا ما تبي عشوائي اطرح كودك ذذ
  15. طيب ليه ما تسوي ماركر او كول شيب والي يدخله تتحقق انه زومبي ويموت ذذ getElementModel isPedZombie
  16. انشاء الله > إن شاء الله وبالتوفيق إن شاء الله نشوف ابداعاتك ذذ
  17. الله يسلمك, حيآك الله , ونصيحه ثاني مره حاول تسوي اكواد ترا ما بتنجح كذا , بالتوفيق,
  18. اضغط على مود الادمنيه مرتين, وشوف مكتوب , Mute durations اضغط عليها مرتين, واكتب العدد الي تبيه مثلا امسح الصفر آخر شيء وحط 9000 يطلع ساعتين ذذ
  19. Check out this : viewtopic.php?f=160&t=65701&p=619160#p619160
  20. بسآعد عشان الموضوع الاول ما أبي ارفعه, سويت طريقه يمكن معقده شوي , اذا احد عنده غيرها يجي يطرحها ذذ, fr_client.lua : CONTROL_MARGIN_RIGHT = 5 LINE_MARGIN = 5 LINE_HEIGHT = 16 g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Me = getLocalPlayer() server = createServerCallInterface() guiSetInputMode("no_binds_when_editing") --------------------------- -- Set skin window --------------------------- function skinInit() setControlNumber(wndSkin, 'skinid', getElementModel(g_Me)) end function showSkinID(leaf) if leaf.id then setControlNumber(wndSkin, 'skinid', leaf.id) end end function applySkin() local skinID = getControlNumber(wndSkin, 'skinid') if skinID then server.setMySkin(skinID) fadeCamera(true) end end wndSkin = { 'wnd', text = 'Set skin', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='skinlist', width=230, height=290, columns={ {text='Skin', attr='name'} }, rows={xml='skins.xml', attrs={'id', 'name'}}, onitemclick=showSkinID, onitemdoubleclick=applySkin }, {'txt', id='skinid', text='', width=50}, {'btn', id='set', onclick=applySkin}, {'btn', id='close', closeswindow=true} }, oncreate = skinInit } function setSkinCommand(cmd, skin) skin = skin and tonumber(skin) if skin then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) end end addCommandHandler('setskin', setSkinCommand) addCommandHandler('ss', setSkinCommand) --------------------------- --- Set animation window --------------------------- function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } addCommandHandler('anim', function(command, lib, name) server.setPedAnimation(g_Me, lib, name, true, true) end ) --------------------------- -- Weapon window --------------------------- function addWeapon(leaf, amount) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndWeapon, 'weaplist') amount = getControlNumber(wndWeapon, 'amount') if not amount or not leaf then return end end server.giveMeWeapon(leaf.id, amount) end wndWeapon = { 'wnd', text = 'Give weapon', width = 250, controls = { { 'lst', id='weaplist', width=230, height=280, columns={ {text='Weapon', attr='name'} }, rows={xml='weapons.xml', attrs={'id', 'name'}}, onitemdoubleclick=function(leaf) addWeapon(leaf, 500) end }, {'br'}, {'txt', id='amount', text='500', width=60}, {'btn', id='add', onclick=addWeapon}, {'btn', id='close', closeswindow=true} } } function giveWeaponCommand(cmd, weapon, amount) weapon = tonumber(weapon) or getWeaponIDFromName(weapon) if not weapon then return end amount = amount and tonumber(amount) or 500 server.giveMeWeapon(math.floor(weapon), amount) end addCommandHandler('give', giveWeaponCommand) addCommandHandler('wp', giveWeaponCommand) --------------------------- -- Fighting style --------------------------- addCommandHandler('setstyle', function(cmd, style) style = style and tonumber(style) if style then server.setPedFightingStyle(g_Me, style) end end ) --------------------------- -- Clothes window --------------------------- function clothesInit() if getElementModel(g_Me) ~= 0 then errMsg('You must have the CJ skin set in order to apply clothes.') closeWindow(wndClothes) return end if not g_Clothes then triggerServerEvent('onClothesInit', g_Me) end end addEvent('onClientClothesInit', true) addEventHandler('onClientClothesInit', g_Root, function(clothes) g_Clothes = clothes.allClothes for i,typeGroup in ipairs(g_Clothes) do for j,cloth in ipairs(typeGroup.children) do if not cloth.name then cloth.name = cloth.model .. ' - ' .. cloth.texture end cloth.wearing = clothes.playerClothes[typeGroup.type] and clothes.playerClothes[typeGroup.type].texture == cloth.texture and clothes.playerClothes[typeGroup.type].model == cloth.model or false end table.sort(typeGroup.children, function(a, b) return a.name < b.name end) end bindGridListToTable(wndClothes, 'clothes', g_Clothes, false) end ) function clothListClick(cloth) setControlText(wndClothes, 'addremove', cloth.wearing and 'remove' or 'add') end function applyClothes(cloth) if not cloth then cloth = getSelectedGridListLeaf(wndClothes, 'clothes') if not cloth then return end end if cloth.wearing then cloth.wearing = false setControlText(wndClothes, 'addremove', 'add') server.removePlayerClothes(g_Me, cloth.parent.type) else local prevClothIndex = table.find(cloth.siblings, 'wearing', true) if prevClothIndex then cloth.siblings[prevClothIndex].wearing = false end cloth.wearing = true setControlText(wndClothes, 'addremove', 'remove') server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type) end end wndClothes = { 'wnd', text = 'Clothes', x = -20, y = 0.3, width = 350, controls = { { 'lst', id='clothes', width=
  21. ولكن بيكون صعب كل مره تسوي تشيلد و...الخ xml صحيح انه سهل setAccountData افضل بكثير, بالنسبه لـ لون النك مثل لون التيم , الحين تقصد بالتاب ولا بالشات, اذا بالشات, setPlayerName getPlayerName string.gsub getPlayerTeam - getTeamFromName getTeamColor RGBToHex بالنسبه للماركر, addCommandHandler table -- للماركر # isElement - destroyElement -- تحقق اذا كان موجود تحذفه عشان ما يكرر كثير # getElementPosition -- تجيب احداثيات اللاعب عشان تجيب الماركر عنده # createMarker واذا لمس الماركر, onMarkerHit getElementType triggerClientEvent guiGetVisible -- تتحقق انها مو ظاهره # guiSetVisible -- تظهرها # واذا ضغط الزر, onClientGUIClick triggerServerEvent -- ترسل تريقر للسيرفر عشان يعطيه الفلوس # givePlayerMoney
  22. تبي تحفظ وش بالضبط؟ احداثيات ولا وش؟
×
×
  • Create New...