-
Posts
999 -
Joined
-
Last visited
Everything posted by K1NG
-
1- startResource 2- https://forum.multitheftauto.com/viewtopic.php?f=164&t=56729 3- restartResource صراحة مافهمت وش تقول، الزبدة اذا تقصد انه يسوي ريستارت للسكربت استخدم اما اذا تقصد ان السكربت ماتقدر تسوله ريستارت أبد فإستخدم هالطريقة
-
...لأن الفنكشن ذاكـ قديم وممكن يبطل يشتغل معآكـ بالإصدارات القادمة 1.4 setPedArmor < setPlayerArmor صح بس استخدم بدال + setElementModel دام فيه عندكـ أرقمنت بوظيفة سباون اللاعب يحدد لكـ شخصية اللاعب .. ليه تتعب نفسكـ وتستخدم وظيفة setElementHealth وبالنسبة لوظيفة تحديد صحة اللاعب، اللاعب يوم تسوله سباون تكون صحته 100% تلقائياً يعني ما يحتاج تحددها بوظيفة .. المهم كودكـ يصير كذا -- Server Side # addEventHandler ( "onPlayerJoin", root, function ( ) spawnPlayer ( source, x, y, z, rotation, skinID ) setPedArmor ( source, Armor ) end ) ممكن اكواد تعطيني مان اتعود اسوي عطنياكواد وبركبها بجرب سو اذا كبست على زر "ل" يسوي سيارة ويخلي لونها اصفر، ثم يخلي صحة السيارة "500" ويحطني بداخلها / طبعاً سو المتغيرات عن طريق جدول
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=7998 يمديكـ تستخدم هالسكربت وتعدل عليه بحيث تقلل عدد الماركرات وتسوي شرط بالحدث حق إلي يوم تلمس الماركر تجيكـ اللوحة بحيث إذا اللاعب من هالقروب تفتح النافذة وكذا عشان تتحقق من قروب اللاعب getElementData تحتاج إنكـ تستخدم وظيفة
-
...لأن الفنكشن ذاكـ قديم وممكن يبطل يشتغل معآكـ بالإصدارات القادمة 1.4 setPedArmor < setPlayerArmor صح بس استخدم بدال + setElementModel دام فيه عندكـ أرقمنت بوظيفة سباون اللاعب يحدد لكـ شخصية اللاعب .. ليه تتعب نفسكـ وتستخدم وظيفة setElementHealth وبالنسبة لوظيفة تحديد صحة اللاعب، اللاعب يوم تسوله سباون تكون صحته 100% تلقائياً يعني ما يحتاج تحددها بوظيفة .. المهم كودكـ يصير كذا -- Server Side # addEventHandler ( "onPlayerJoin", root, function ( ) spawnPlayer ( source, x, y, z, rotation, skinID ) setPedArmor ( source, Armor ) end )
-
هاذي معناها احداثيات المكان الي يكون فيه الصوت انا حاطها لك فوق بمتغيرات بس حط الاحدثيات مكان المتغيرات وهي بتتغير هنا لحالها
-
. يب حط اسمه والمسار حقه ، وتقدر تحط رابط مباشر من النت للصوت بدلاً من ملف الصوت
-
local x, y, z = 0, 0, 0 -- إحداثيات مكان الصوت local soundPath = "مسار ملف الصوت" -- Example / مثال -> "sounds/quran.mp3" addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) local sound = playSound3D ( soundPath, x, y, z, true ) setSoundMaxDistance ( sound, 100 ) end )
-
'-.- مايبيله شرح !!! اكبس عليه ورح تفهمه ع السريع، حاول تعتمد ع نفسكـ
-
كابيتال ؟ Pوحرف الـ Police اول شي هل إنه تيم الشرطة الي عندكـ إسمه SWAT ثاني شي تأكد إنكـ بعصابة ثم تلقى تحت ع اليمين فراغ مكتوب فيه كلام احمر اكبس عليه Resources عشان تتأكد أكثر رح افتح الادمنية ثم رح لتاب ثم الصق الكود ذا فيه outputChatBox ( getElementData ( source, "gang" ), source ) .. وقلي وش يجيكـ بالشات server ثم اكبس على زر
-
متأكد ان الكود بجانب سيرفر ؟ + يوم تلمس الماركر عشان يضبط معكـ SWAT وبداخل عصابة Police لازم تكون تكون بتيم إذا متأكد من هالأشياء قلي وش يجيكـ بالديبق يوم تلمس الماركر /debugscript 3
-
ما يحتاج تتحقق إذا اللاعب مهو بداخل السيارة يوم يطلع من الماركر، لأنه لنفرض ان اللاعب يوم دخل الماركر اخذ سيارة وهو بداخل الماركر ثم طلع من الماركر وهو بالسيارة بكذا رح يضل التايمر ماشي وهو خارج الماركر ويوصله فلوس .. وفيه عندكـ أخطاء بتعريف اللاعب بوظيفة التايمر الي بحدث دخول الماركر وانت بعد مسوي مثل طلال بالتحقق يوم يخرج من الماركر وعندكـ بعد خطأ بتعريف اللاعب بالوظيفة حقت التايمر ------- بالنسبة لصاحب الموضوع، الكود يصير كذا -- Server Side # local times = { } local Marker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 255 ) addEventHandler ( "onMarkerHit", Marker, function ( element ) if ( getElementType ( element ) == "player" ) then if ( times[element] ) and ( isTimer ( times[element] ) )then killTimer ( times[element] ) times[element] = nil end times[element] = setTimer ( function ( element ) givePlayerMoney ( element, 9000 ) end, 120000, 0, element ) end end ) addEventHandler ( "onMarkerLeave", Marker, function ( element ) if ( getElementType ( element ) == "player" ) and ( times[element] ) and ( isTimer ( times[element] ) ) then killTimer ( times[element] ) times[element] = nil end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( times[source] ) and ( isTimer ( times[source] ) ) then killTimer ( times[source] ) times[source] = nil end end )
-
-- Server Side # local groupName = "SWAT" local oH = createMarker(1265.0999755859,-1627.9000244141,29.89999961853,"arrow",1.5,0,255,0) addEventHandler ( "onMarkerHit", oH, function ( player ) if ( getElementType ( player ) == "player" ) and ( getPlayerTeam ( player ) ) and ( getTeamName ( getPlayerTeam ( player ) ) == "Police" ) and ( getElementData ( player, "gang" ) == groupName ) then setElementInterior ( player, 0, 1222.29956, -1655.51770, 140.20313 ) setElementDimension ( player, 0 ) end end )
-
.. فيه عندكـ قوس زايد ونقص بالتحققات بالسطر السادس، يصير كذا -- Server Side # marker = createMarker ( 1264.1999511719, -1671.5999755859, 12.60000038147, "cylinder", 2, 255, 0, 255, 255 ) addEventHandler ( "onMarkerHit", marker, function ( player ) if ( getElementType ( player ) == "player" ) and ( getPlayerTeam ( player ) ) and ( getTeamName ( getPlayerTeam ( player ) ) == "Police" ) then if ( getElementData ( player, "gang" ) == "SWAT" ) then setElementHealth ( player, 100 ) setPedArmor ( player, 100 ) setElementModel ( player, 285 ) else outputChatBox ( "* You most be SWAT Group ", player, 0, 0, 255, true ) end end end )
-
فقط عشان تتحقق اذا اللاعب داخل الماركر او لا isElementWithinMarker اذا انت مسوي الماركر بالفري روم وبجانب كلنت فـ تحتاج تستخدم أما اذا مسوي الماركر بمود آخر او مسويها بالفري روم وبجانب سيرفر فـ تحتاج إنكـ تستخدم setElementData getElementData
-
ممكن شرح https://wiki.multitheftauto.com/wiki/Resource:Customblips الشرح والأمثلة هنا
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=960 https://wiki.multitheftauto.com/wiki/Resource:Customblips • createCustomBlip .. اول شي حمل السكربت، ثم شف الشرح حقه بالرابط الثاني تلقى فيه امثلة وشرح لكل وظيفة
-
-- Client Side # function IronMan ( ) if ( getElementModel ( source ) == 46 ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, IronMan ) addEventHandler ( "onClientPlayerStealthKill", localPlayer, IronMan )
-
المشكله يقدر يذبحه بالسكين onClientPlayerStealthKill
-
شــرح ربـــط الــكــود بـألـقـريــد لـيـســت @~!..
K1NG replied to |~| ALCKASER |~|'s topic in دروس في البرمجة
والله شكله انت الي يبيلكـ احد يشرحلكـ يا عزيزي لأنه اشوفكـ مسوي هريسة بشرح الإندات ماتعرف الإند الأول وش يغلق والثاني والثالث بعد، شكلكـ تنسخ وتلصق وماتعرف وش السالفة !!! وبعدين ذا تسميه شرح ؟ قال نحط ذا بعد نحط ذا وبالآخر يصير كذا يا ربآآآهـ، أهني أهلك يَ شششيخ لا والأقوى من ذا كله إنه مسوي اخفاء لمؤشر الماوس وهو مافيه مؤشر اصلاً، وبعدين شلون الواحد بيضغط الزر وهو مافيه لانافذة ولا زر بالأصل ؟ ولنفرض انه مسويها فوق، بيصير يوم يكبس الزر يروح الماوس وتضل النافذة )= وبعدين انت شرحكـ كله عن القريد لست صح ؟ وين اكواد انشاء القريد لست ماشوفها ؟ لايكون نسيت تنسخها ! أها سوري توي ادري (= الزبدة، اهنيكـ ع الششرح الأكثر من رآئع -
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 50, 1, source, playerHealth) setTimer (setPedArmor, 50, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onLogout () kickPlayer (source, nil, "Logging out is disallowed.") end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) function onQuit ( ) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local x,y,z = getElementPosition (source) setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source))) setAccountData (account, "funmodev2-health", tostring (getElementHealth (source))) setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source))) setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0)) setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1)) setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2)) setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3)) setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4)) setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5)) setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6)) setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7)) setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, ) setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9)) setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10)) setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11)) setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12)) setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, ) setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth, player) local theWeapon = getPedWeapon (source) local weaponAmmo = getPedTotalAmmo (source) setTimer (giveWeapon, 5000, 1, source, theWeapon, weaponAmmo, true) end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) .. لأنه يخرب الكود يوم احطه lua حطيت لكـ الكود بدون تاج
-
المهم كودكـ يصير كذا -- Client Side # GUIEditor = { window = {} } addEventHandler ( "onClientResourceStart", resourceRoot, function( ) GUIEditor.window[1] = guiCreateWindow(544, 226, 239, 200, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) button1 = guiCreateButton(57, 63, 111, 75, "", false, GUIEditor.window[1]) TheWindow = guiCreateWindow(544, 226, 239, 200, "", false) guiSetVisible ( TheWindow, false ) end ) addEventHandler ( "onClientGUIClick", button1, function ( ) guiSetVisible ( TheWindow, true ) guiBringToFront ( TheWindow ) end, false ) ^ وبالنسبة إلى ملف الميتا شف شرح الويكي وطبق عليه وطبعاً الكود ذا بجانب كلنت https://wiki.multitheftauto.com/wiki/Meta.xml
-
يكون له فائدة كبيرة يوم تحط وظايف واجهة المستخدم الرسومية فيه في بعض الأوقات onClientResourceStart للمعلومية حدث رح يصير أخطاء يوم تشغل السكربت (cache) لأنه يوم الواحد يحذف ملف الكلنت الي فيه وظايف انشاء النوافذ وغيرهـ عن طريق الميتا رح تلاحظ ان النوافذ بتجيك كبر الشاشة وتكون كلها ملخبطة ولا شي راكب ع بعضه والصور الي بالنافذة ما بتجي ولا شي في المرة الأولى الي يتحمل فيها السكربت على جهازكـ .. مع هالوظايف، رح يريحكـ من هالمشاكل ذي كلها onClientResourceStart عشان كذا يوم تستخدم حدث