mr.Extreme Posted September 28, 2013 Share Posted September 28, 2013 اسلام عليكم انا عندي سيرفر فريروم هذا الاكواد وظيفة لاعب لما ينزل سيارة بجانب الجدار او الباب الخ ....... يظهر رسالة Please find a clear location to spawn the vehicle. اما اذا كان هو مو عند الجدران او ابواب ينزل سيارة client side : 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, } function isTheLineClear(vx, vy, vz, vehID, vrot) local width = vehicleWidth[vehID] or 3 local px,py,pz = getElementPosition(source) 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("onPlayerVehicleCreate", source, vx, vy, vz, vehID, vrot) else errMsg('Please find a clear location to spawn the vehicle.') end end addEvent("onClientLineCheck", true) addEventHandler("onClientLineCheck", getRootElement(), isTheLineClear) طبعا ناقص اكواد في سيرفر سيد server side: وهذا علشان منع الهكر في سيرفر وشكرا علي مساعدة Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 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, } function isTheLineClear(vx, vy, vz, vehID, vrot) local width = vehicleWidth[vehID] or 3 local px,py,pz = getElementPosition(localPlayer) 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("onPlayerVehicleCreate", localPlayer, vx, vy, vz, vehID, vrot) else errMsg('Please find a clear location to spawn the vehicle.') end end addEvent("onClientLineCheck", true) addEventHandler("onClientLineCheck", getRootElement(), isTheLineClear) Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 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, } function isTheLineClear(vx, vy, vz, vehID, vrot) local width = vehicleWidth[vehID] or 3 local px,py,pz = getElementPosition(localPlayer) 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("onPlayerVehicleCreate", localPlayer, vx, vy, vz, vehID, vrot) else errMsg('Please find a clear location to spawn the vehicle.') end end addEvent("onClientLineCheck", true) addEventHandler("onClientLineCheck", getRootElement(), isTheLineClear) ????? ما في رد Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 ؟ ._. هذا كودك عدلته انسخه وجربه Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 ؟._. هذا كودك عدلته انسخه وجربه مااا اشتغل بس الناقص اكواد سيرفر سيد Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 الحين وين السيرفر؟ طرح كود السيرفر؟ Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 لان في كود triggerServerEvent بدي اسوي اتصال في سيرفر سيد بس انا ما عرفت اسوي بس انا ما عندي اكواد سيرفر سيد كنت بحاول ما عرفت Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 triggerServerEvent('TriggerName',element,arguments...) مثال, triggerServerEvent('SendText',localPlayer,Text) طبعا لازم تفعل التريقر من السيرفر, addEvent('SendText',true) addEventHandler('SendText',root, function(Text) -- Your code # end ) ونفس الطريقه من السيرفر وتفعله في الكلنت, الحين انت تبي هذا الكود للفري روم صح؟ Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 triggerServerEvent('TriggerName',element,arguments...) مثال, triggerServerEvent('SendText',localPlayer,Text) طبعا لازم تفعل التريقر من السيرفر, addEvent('SendText',true) addEventHandler('SendText',root, function(Text) -- Your code # end ) ونفس الطريقه من السيرفر وتفعله في الكلنت, الحين انت تبي هذا الكود للفري روم صح؟ انت مش فاهم قصدي Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 الي فهمته انك تبيه يوم ينزل سياره من الفري روم يتحقق اذا كان جنبه اي شيء سياره او جدار او...الخ ما ينزل سياره واذا مو جنبه اي شيء ينزل ! اذا انا غلطان فهمني Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 الي فهمته انك تبيه يوم ينزل سياره من الفري روم يتحقق اذا كان جنبه اي شيء سياره او جدار او...الخ ما ينزل سياره واذا مو جنبه اي شيء ينزل !اذا انا غلطان فهمني لا مو غلطان طيب رد ممكن تدخل هذا الموضوع تفهم اكثر https://forum.multitheftauto.com/viewtopic.php?f=160&t=65145 Link to comment
iMr.Dawix~# Posted September 28, 2013 Share Posted September 28, 2013 الي فهمته انك تبيه يوم ينزل سياره من الفري روم يتحقق اذا كان جنبه اي شيء سياره او جدار او...الخ ما ينزل سياره واذا مو جنبه اي شيء ينزل !اذا انا غلطان فهمني اتوقع انه زرف المود من ملف رسورس حمله وجاب الكلنت بس Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 الي فهمته انك تبيه يوم ينزل سياره من الفري روم يتحقق اذا كان جنبه اي شيء سياره او جدار او...الخ ما ينزل سياره واذا مو جنبه اي شيء ينزل !اذا انا غلطان فهمني اتوقع انه زرف المود من ملف رسورس حمله وجاب الكلنت بس صحيح بس كيف بدي اسويلو سيرفرسيد Link to comment
xFace[B]ook Posted September 28, 2013 Share Posted September 28, 2013 الي فهمته انك تبيه يوم ينزل سياره من الفري روم يتحقق اذا كان جنبه اي شيء سياره او جدار او...الخ ما ينزل سياره واذا مو جنبه اي شيء ينزل !اذا انا غلطان فهمني اتوقع انه زرف المود من ملف رسورس حمله وجاب الكلنت بس صحيح بس كيف بدي اسويلو سيرفرسيد الزرف مو زين >< Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 pls pls pls pls pls ارجو المساعدة Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 بسآعد عشان الموضوع الاول ما أبي ارفعه, سويت طريقه يمكن معقده شوي , اذا احد عنده غيرها يجي يطرحها ذذ, 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= Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 بسآعد عشان الموضوع الاول ما أبي ارفعه,سويت طريقه يمكن معقده شوي , اذا احد عنده غيرها يجي يطرحها ذذ, 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 = { { Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 الله يسلمك, حيآك الله , ونصيحه ثاني مره حاول تسوي اكواد ترا ما بتنجح كذا , بالتوفيق, Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 لسة انا جديد في سكربتات هيني بتعلم حتي اكون مثلكم انشاء الله Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 لسة انا جديد في سكربتات هيني بتعلم حتي اكون مثلكم انشاء الله انشاء الله > إن شاء الله وبالتوفيق إن شاء الله نشوف ابداعاتك ذذ Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 لسة انا جديد في سكربتات هيني بتعلم حتي اكون مثلكم انشاء الله انشاء الله > إن شاء الله وبالتوفيق إن شاء الله نشوف ابداعاتك ذذ انشاء الله Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 طيب هذا الكود triggerClientEvent('Checks',source,vx,vy,vz,vehID,vrot) وين بدي حطة 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 local 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 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 else errMsg(getVehicleNameFromModel(vehID):gsub('y$', 'ie') .. 's are not allowed', source) end end end Link to comment
فاّرس Posted September 28, 2013 Share Posted September 28, 2013 (edited) ما ادري اذا عندك الفري روم الاصلي الي مو معدل , ولكن التعديل يكون في الوظيفه حق السياره , 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 او جرب كود Edited September 28, 2013 by Guest Link to comment
mr.Extreme Posted September 28, 2013 Author Share Posted September 28, 2013 SKYPE: lion.lions6 Link to comment
mr.Extreme Posted October 12, 2013 Author Share Posted October 12, 2013 ما ادري اذا عندك الفري روم الاصلي الي مو معدل ,ولكن التعديل يكون في الوظيفه حق السياره , 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 او جرب كود السلام عليكم ذي بيست المود شغال بس مشكلته اذا حاولت انزل سياره بجنب شخص بينزل سيارتين واذا حاولت انزل بجنب 3 اشخاص ينزل 3 سيارات تضهر لكل الاعبيه Please find a clear location to spawn the vehicle. وكمان هاذي الرساله 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