D7mas Posted September 3, 2017 Share Posted September 3, 2017 السلام عليكم بدون مقدمات انا متت وانا اكتب واحاول اسوي مود يحفظ السلحة عند الخروج من السيرفر بس ما يزبط بلله سرريع مساعدة ممكن تصلحو ؟ function saveWeaponsOnQuit() local account = getPlayerAccount(source) local weapon0 = getPedWeapon(source,0) local weapon1 = getPedWeapon(source,1) local weapon2 = getPedWeapon(source,2) local weapon3 = getPedWeapon(source,3) local weapon4 = getPedWeapon(source,4) local weapon5 = getPedWeapon(source,5) local weapon6 = getPedWeapon(source,6) local weapon7 = getPedWeapon(source,7) local weapon8 = getPedWeapon(source,8) local weapon9 = getPedWeapon(source,9) local weapon10 = getPedWeapon(source,10) local weapon11 = getPedWeapon(source,11) local weapon12 = getPedWeapon(source,12) local ammo0 = getPedTotalAmmo(source,0) local ammo1 = getPedTotalAmmo(source,1) local ammo2 = getPedTotalAmmo(source,2) local ammo3 = getPedTotalAmmo(source,3) local ammo4 = getPedTotalAmmo(source,4) local ammo5 = getPedTotalAmmo(source,5) local ammo6 = getPedTotalAmmo(source,6) local ammo7 = getPedTotalAmmo(source,7) local ammo8 = getPedTotalAmmo(source,8) local ammo9 = getPedTotalAmmo(source,9) local ammo10 = getPedTotalAmmo(source,10) local ammo11 = getPedTotalAmmo(source,11) local ammo12 = getPedTotalAmmo(source,12) if not isGuestAccount(account) then setAccountData(account,"weapon0",weapon0) setAccountData(account,"weapon1",weapon1) setAccountData(account,"weapon2",weapon2) setAccountData(account,"weapon3",weapon3) setAccountData(account,"weapon4",weapon4) setAccountData(account,"weapon5",weapon5) setAccountData(account,"weapon6",weapon6) setAccountData(account,"weapon7",weapon7) setAccountData(account,"weapon8",weapon8) setAccountData(account,"weapon9",weapon9) setAccountData(account,"weapon10",weapon10) setAccountData(account,"weapon11",weapon11) setAccountData(account,"weapon12",weapon12) setAccountData(account,"ammo0",ammo0) setAccountData(account,"ammo1",ammo1) setAccountData(account,"ammo2",ammo2) setAccountData(account,"ammo3",ammo3) setAccountData(account,"ammo4",ammo4) setAccountData(account,"ammo5",ammo5) setAccountData(account,"ammo6",ammo6) setAccountData(account,"ammo7",ammo7) setAccountData(account,"ammo8",ammo8) setAccountData(account,"ammo9",ammo9) setAccountData(account,"ammo10",ammo10) setAccountData(account,"ammo11",ammo11) setAccountData(account,"ammo12",ammo12) end end addEventHandler("onPlayerQuit",root,saveWeaponsOnQuit) function saveWeaponsOnLogout(previousaccount,currentaccount) local weapon0 = getPedWeapon(source,0) local weapon1 = getPedWeapon(source,1) local weapon2 = getPedWeapon(source,2) local weapon3 = getPedWeapon(source,3) local weapon4 = getPedWeapon(source,4) local weapon5 = getPedWeapon(source,5) local weapon6 = getPedWeapon(source,6) local weapon7 = getPedWeapon(source,7) local weapon8 = getPedWeapon(source,8) local weapon9 = getPedWeapon(source,9) local weapon10 = getPedWeapon(source,10) local weapon11 = getPedWeapon(source,11) local weapon12 = getPedWeapon(source,12) local ammo0 = getPedTotalAmmo(source,0) local ammo1 = getPedTotalAmmo(source,1) local ammo2 = getPedTotalAmmo(source,2) local ammo3 = getPedTotalAmmo(source,3) local ammo4 = getPedTotalAmmo(source,4) local ammo5 = getPedTotalAmmo(source,5) local ammo6 = getPedTotalAmmo(source,6) local ammo7 = getPedTotalAmmo(source,7) local ammo8 = getPedTotalAmmo(source,8) local ammo9 = getPedTotalAmmo(source,9) local ammo10 = getPedTotalAmmo(source,10) local ammo11 = getPedTotalAmmo(source,11) local ammo12 = getPedTotalAmmo(source,12) setAccountData(previousaccount,"weapon0",weapon0) setAccountData(previousaccount,"weapon1",weapon1) setAccountData(previousaccount,"weapon2",weapon2) setAccountData(previousaccount,"weapon3",weapon3) setAccountData(previousaccount,"weapon4",weapon4) setAccountData(previousaccount,"weapon5",weapon5) setAccountData(previousaccount,"weapon6",weapon6) setAccountData(previousaccount,"weapon7",weapon7) setAccountData(previousaccount,"weapon8",weapon8) setAccountData(previousaccount,"weapon9",weapon9) setAccountData(previousaccount,"weapon10",weapon10) setAccountData(previousaccount,"weapon11",weapon11) setAccountData(previousaccount,"weapon12",weapon12) setAccountData(previousaccount,"ammo0",ammo0) setAccountData(previousaccount,"ammo1",ammo1) setAccountData(previousaccount,"ammo2",ammo2) setAccountData(previousaccount,"ammo3",ammo3) setAccountData(previousaccount,"ammo4",ammo4) setAccountData(previousaccount,"ammo5",ammo5) setAccountData(previousaccount,"ammo6",ammo6) setAccountData(previousaccount,"ammo7",ammo7) setAccountData(previousaccount,"ammo8",ammo8) setAccountData(previousaccount,"ammo9",ammo9) setAccountData(previousaccount,"ammo10",ammo10) setAccountData(previousaccount,"ammo11",ammo11) setAccountData(previousaccount,"ammo12",ammo12) takeAllWeapons(source) end addEventHandler("onPlayerLogout",root,saveWeaponsOnLogout) function loadWeaponsOnLogin(previousaccount,currentaccount) local weapon0 = getAccountData(currentaccount,"weapon0") local weapon1 = getAccountData(currentaccount,"weapon1") local weapon2 = getAccountData(currentaccount,"weapon2") local weapon3 = getAccountData(currentaccount,"weapon3") local weapon4 = getAccountData(currentaccount,"weapon4") local weapon5 = getAccountData(currentaccount,"weapon5") local weapon6 = getAccountData(currentaccount,"weapon6") local weapon7 = getAccountData(currentaccount,"weapon7") local weapon8 = getAccountData(currentaccount,"weapon8") local weapon9 = getAccountData(currentaccount,"weapon9") local weapon10 = getAccountData(currentaccount,"weapon10") local weapon11 = getAccountData(currentaccount,"weapon11") local weapon12 = getAccountData(currentaccount,"weapon12") local ammo0 = getAccountData(currentaccount,"ammo0") local ammo1 = getAccountData(currentaccount,"ammo1") local ammo2 = getAccountData(currentaccount,"ammo2") local ammo3 = getAccountData(currentaccount,"ammo3") local ammo4 = getAccountData(currentaccount,"ammo4") local ammo5 = getAccountData(currentaccount,"ammo5") local ammo6 = getAccountData(currentaccount,"ammo6") local ammo7 = getAccountData(currentaccount,"ammo7") local ammo8 = getAccountData(currentaccount,"ammo8") local ammo9 = getAccountData(currentaccount,"ammo9") local ammo10 = getAccountData(currentaccount,"ammo10") local ammo11 = getAccountData(currentaccount,"ammo11") local ammo12 = getAccountData(currentaccount,"ammo12") if (weapon0) and (weapon1) and (weapon2) and (weapon3) and (weapon4) and (weapon5) and (weapon6) and (weapon7) and (weapon8) and (weapon9) and (weapon10) and (weapon11) and (weapon12) and (ammo0) and (ammo1) and (ammo2) and (ammo3) and (ammo4) and (ammo5) and (ammo6) and (ammo7) and (ammo8) and (ammo9) and (ammo10) and (ammo11) and (ammo12) then giveWeapon(source,weapon0,ammo0) giveWeapon(source,weapon1,ammo1) giveWeapon(source,weapon2,ammo2) giveWeapon(source,weapon3,ammo3) giveWeapon(source,weapon4,ammo4) giveWeapon(source,weapon5,ammo5) giveWeapon(source,weapon6,ammo6) giveWeapon(source,weapon7,ammo7) giveWeapon(source,weapon8,ammo8) giveWeapon(source,weapon9,ammo9) giveWeapon(source,weapon10,ammo10) giveWeapon(source,weapon11,ammo11) giveWeapon(source,weapon12,ammo12) end end addEventHandler("onPlayerLogin",root,loadWeaponsOnLogin) Link to comment
#BrosS Posted September 3, 2017 Share Posted September 3, 2017 addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then for slot = 1, 12 do setAccountData(account, "WeaponID"..slot, getPedWeapon(source, slot)) setAccountData(account, "Ammo"..slot, getPedTotalAmmo(source, slot)) end end end); addEventHandler("onPlayerLogin", root, function(_, account) for slot = 1, 12 do local wep = getAccountData(account, "WeaponID"..slot) local ammo = getAccountData(account, "Ammo"..slot) if wep and ammo then giveWeapon(source, wep, ammo) end end end); Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 45 minutes ago, #BrosS said: الاكواد بس ممكن تقلي كيف استثني الخلاط والسلحة الثقيلة؟؟ 50 minutes ago, #BrosS said: ما زبط الاكواد وش اسوي احطه بقروب الادمن ؟؟ Link to comment
Omoi Posted September 3, 2017 Share Posted September 3, 2017 18 minutes ago, D7mas said: بس ممكن تقلي كيف استثني الخلاط والسلحة الثقيلة؟؟ ما زبط الاكواد وش اسوي احطه بقروب الادمن ؟؟ اكيد لازم تحطه Link to comment
SycroX Posted September 3, 2017 Share Posted September 3, 2017 4 minutes ago, Omoi said: اكيد لازم تحطه اكيد 100% ما لازم يحطو - المود مايحتاج صلاحيات الأدمن + كود بروس صحيح ما به شي تاكد انك حاطو في server side Link to comment
Omoi Posted September 3, 2017 Share Posted September 3, 2017 2 minutes ago, #x1AhMeD,-09 said: اكيد 100% ما لازم يحطو - المود مايحتاج صلاحيات الأدمن + كود بروس صحيح ما به شي تاكد انك حاطو في server side مم غريبه , لكن شكرا على التصحيح اخوي . Link to comment
SycroX Posted September 3, 2017 Share Posted September 3, 2017 @Omoi المودات الي تحتاح صلاحيات الأدمن هي المودات الي يكون فيها فانكشنات ادمنيه مثل kickPlayer redirectPlayer banPlayer الخ Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 10 minutes ago, #x1AhMeD,-09 said: @Omoi المودات الي تحتاح صلاحيات الأدمن هي المودات الي يكون فيها فانكشنات ادمنيه مثل kickPlayer redirectPlayer banPlayer الخ كيف ابي احط سكربت كامل في الكلنت سايد Link to comment
#BrosS Posted September 3, 2017 Share Posted September 3, 2017 Just now, D7mas said: كيف ابي احط سكربت كامل في الكلنت سايد سيرفر ماينفع كلينت Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 1 minute ago, #BrosS said: سيرفر ماينفع كلينت ما زبط تقدر تسويلي اياه ؟ Link to comment
#BrosS Posted September 3, 2017 Share Posted September 3, 2017 Just now, D7mas said: ما زبط تقدر تسويلي اياه ؟ كودي صحيح وقلت لك استعمله بسيرفر سايد اذا ماظبط المشكلة منك انت مارح اكثر كلام Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 Just now, #BrosS said: كودي صحيح وقلت لك استعمله بسيرفر سايد اذا ماظبط المشكلة منك انت مارح اكثر كلام ما تقدر تحطو في الكلنت سايد وتعطيني اياه ؟ افا , اوكي انتضر شخص يساعني غيرك Link to comment
Omoi Posted September 3, 2017 Share Posted September 3, 2017 Just now, D7mas said: ما تقدر تحطو في الكلنت سايد وتعطيني اياه ؟ افا , اوكي انتضر شخص يساعني غيرك م ينفع الاكاونت داتا على الكلنت !! لازم سيرفر Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 triggerServerEvent("onPlayerSpawn", root, "onPlayerLogin", root) addEventHandler("onPlayerQuit", root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then for slot = 1, 12 do setAccountData(account, "WeaponID"..slot, getPedWeapon(source, slot)) setAccountData(account, "Ammo"..slot, getPedTotalAmmo(source, slot)) end end end); addEventHandler("onPlayerLogin", root, function(_, account) for slot = 1, 12 do local wep = getAccountData(account, "WeaponID"..slot) local ammo = getAccountData(account, "Ammo"..slot) if wep and ammo then giveWeapon(source, wep, ammo) end end end) زبطلي اياه 7 minutes ago, Omoi said: Link to comment
Omoi Posted September 3, 2017 Share Posted September 3, 2017 1 minute ago, D7mas said: triggerServerEvent("onPlayerSpawn", root, "onPlayerLogin", root) addEventHandler("onPlayerQuit", root,function()local account = getPlayerAccount(source)if account and not isGuestAccount(account) thenfor slot = 1, 12 dosetAccountData(account, "WeaponID"..slot, getPedWeapon(source, slot))setAccountData(account, "Ammo"..slot, getPedTotalAmmo(source, slot))endendend);addEventHandler("onPlayerLogin", root,function(_, account)for slot = 1, 12 dolocal wep = getAccountData(account, "WeaponID"..slot)local ammo = getAccountData(account, "Ammo"..slot)if wep and ammo thengiveWeapon(source, wep, ammo)endendend) زبطلي اياه يخوي م ينفع تسويه على الكلنت لازم سيرفر ولا مستحيل يشتغل Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 2 minutes ago, Omoi said: يخوي م ينفع تسويه على الكلنت لازم سيرفر ولا مستحيل يشتغل هو على السيرفر يا اخي ما في ملق كلنت اصلاً Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 شباب الترق حقي شغال ؟؟؟ triggerServerEvent("onPlayerSpawn", root, "onPlayerLogin", root) Link to comment
Omoi Posted September 3, 2017 Share Posted September 3, 2017 35 minutes ago, D7mas said: شباب الترق حقي شغال ؟؟؟ triggerServerEvent("onPlayerSpawn", root, "onPlayerLogin", root) كودك كله خطا قلنا لك اخوي خذ كود اخونا بروس وحطه وبيشتغل معك Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 13 minutes ago, Omoi said: كودك كله خطا قلنا لك اخوي خذ كود اخونا بروس وحطه وبيشتغل معك حطيتو يا شيخ بس بقول بدو تسويلو ترق وانا مو عار اسوي ترق ركبي الترق انت وخلاص كلو سطر افا ومنو اتعلم Link to comment
#BrosS Posted September 3, 2017 Share Posted September 3, 2017 Just now, D7mas said: حطيتو يا شيخ بس بقول بدو تسويلو ترق وانا مو عار اسوي ترق ركبي الترق انت وخلاص كلو سطر افا ومنو اتعلم اسمع انا خايف من الله ومن المخالفة اني اغلط قلت لك استعمله سيرفر وخلاص انتهى الموضوع ياليتني اقدر اغلق المواضيع كنت غلقته بس انت ماتفهم Link to comment
D7mas Posted September 3, 2017 Author Share Posted September 3, 2017 Just now, #BrosS said: اسمع انا خايف من الله ومن المخالفة اني اغلط قلت لك استعمله سيرفر وخلاص انتهى الموضوع ياليتني اقدر اغلق المواضيع كنت غلقته بس انت ماتفهم طيب اشرحلي التريق سيرفر مع مثال وخلاص ما فهمت على ويكي Link to comment
#Mr.Pop Posted September 3, 2017 Share Posted September 3, 2017 (edited) TriggerServerEvent هو حدث Client Side تسويه لكي تشغل وضيفة سيرفر في كلينت مثال هذا المثال اذا كان مع شخص فلوس اقل من 100 راح يصير معو 1500 addEventHandler("onClientGUIClick",root, function () if source == Bottun then triggerServerEvent("MyEvent",localPlayer) end end ) addEvent("MyEvent",true) addEventHandler("onClientGUIClick",root, function () if getPlayerMoney(source) <= 100 then setPlayerMoney(source,1500) end end ) مثل 2 يعني تكتب قيمة في الاوديت راح تتحول الى فلوس يعني لم تكتب 100 راح يعي للعب ضضغ على الزر addEventHandler("onClientGUIClick",root, function () local Text4 = guiGetText(Text) if source == Bottun then triggerServerEvent("MyEvent",localPlayer,Text4) end end ) addEvent("MyEvent",true) addEventHandler("onClientGUIClick",root, function (Text4) givePlayerMoney(source,Text4) end end ) مثال 3 توزيع فلوس addEventHandler("onClientGUIClick",root, function () local Text4 = guiGetText(Text) if source == Bottun then triggerServerEvent("MyEvent",localPlayer,Text4) end end ) addEvent("MyEvent",true) addEventHandler("onClientGUIClick",root, function (Text4) for items , vul in ipairs ( getElementsByType("player") ) do givePlayerMoney(vul,Text4) end end end ) Edited September 3, 2017 by #Mr.Pop 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