#Mr.alkmasha Posted December 24, 2014 Share Posted December 24, 2014 addEventHandler('onPlayerQuit',root, function() -- local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount(vAcc) then return end setAccountData(vAcc,'Clothes',getPedClothes (source) end ) addEventHandler('onPlayerLogin',root, function(_,acc) local v_Data = getAccountData(acc,'Clothes') if ( v_Data ) then setPedClothes(source,vData) end end ) سويته يحفض ال Clothes حق سكين 0 Link to comment
nxFairlywell Posted December 24, 2014 Share Posted December 24, 2014 addEventHandler("onPlayerQuit", root, function ( ) local acc = getPlayerAccount(source) if not ( isGuestAccount(acc) ) then setAccountData( acc, "Clothes", getPedClothes( source, 0 ) ) end end ) Link to comment
#Mr.alkmasha Posted December 25, 2014 Author Share Posted December 25, 2014 addEventHandler("onPlayerQuit", root, function ( ) local acc = getPlayerAccount(source) if not ( isGuestAccount(acc) ) then setAccountData( acc, "Clothes", getPedClothes( source, 0 ) ) end end ) ما زبط Link to comment
justboy Posted December 25, 2014 Share Posted December 25, 2014 مافهمت اييش تبي بالظبط بس صلحت شيء addEventHandler('onPlayerQuit',root, function() -- local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount(vAcc) then return end for type = 0,17 do texture, model = getPedClothes(source, type) setAccountData(vAcc,'Clothes',model) end end ) Link to comment
Mr.R Posted December 25, 2014 Share Posted December 25, 2014 (edited) جرب addEventHandler("onPlayerQuit", root, function ( ) local PlayerAccount = getPlayerAccount ( source ) if not vAcc or isGuestAccount ( PlayerAccount ) then return end setAccountData ( PlayerAccount, "Clothes", getPedClothes ( source , 0 ) ) end ) addEventHandler("onPlayerLogin", root, function ( _,acc ) local v_Data = getAccountData ( acc, "Clothes" ) if ( v_Data ) then if getElementModel ( source ) == 0 then setPedClothes ( source, 0 ) end end ) Edit : Edited December 25, 2014 by Guest Link to comment
justboy Posted December 25, 2014 Share Posted December 25, 2014 ^ https://wiki.multitheftauto.com/wiki/SetPedClothes Link to comment
Mr.R Posted December 25, 2014 Share Posted December 25, 2014 ^https://wiki.multitheftauto.com/wiki/SetPedClothes والله اول مره اشوفه هههههه Useful Function هذا الفنكشن جديد من ضمن John : مسويه بس ماظن فيه فرق بين فنكشن setPedClothes و addPedClothes Link to comment
#Mr.alkmasha Posted December 25, 2014 Author Share Posted December 25, 2014 ^https://wiki.multitheftauto.com/wiki/SetPedClothes والله اول مره اشوفه هههههه Useful Function هذا الفنكشن جديد من ضمن John : مسويه بس ماظن فيه فرق بين فنكشن setPedClothes و addPedClothes ما زبط addEventHandler('onPlayerQuit',root, -- function() -- local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount(vAcc) then return end for type = 0,17 do texture, model = getPedClothes(source, type) setAccountData(vAcc,'Clothes',model) end end ) addEventHandler('onPlayerLogin',root, function(_,acc) local v_Data = getAccountData(acc,'Clothes') if ( v_Data ) then addPedClothes ( source,v_Data) end end ) Link to comment
#Mr.alkmasha Posted December 25, 2014 Author Share Posted December 25, 2014 مافهمت اييش تبي بالظبط بس صلحت شيء addEventHandler('onPlayerQuit',root, function() -- local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount(vAcc) then return end for type = 0,17 do texture, model = getPedClothes(source, type) setAccountData(vAcc,'Clothes',model) end end ) كيف مو فاهم شي و صلحت ؟ يا ريت الي ما يفهم ما يساعد Link to comment
nxFairlywell Posted December 25, 2014 Share Posted December 25, 2014 يا ابن الحلال وضح انت تقول سكن 0 وحاط وظيفة جلب ملابس اللاعب !؟ Link to comment
#Mr.alkmasha Posted December 26, 2014 Author Share Posted December 26, 2014 يا ابن الحلال وضحانت تقول سكن 0 وحاط وظيفة جلب ملابس اللاعب !؟ ايه حاطط الوضيفه Link to comment
nxFairlywell Posted December 26, 2014 Share Posted December 26, 2014 طيب وش عرفك ان الكود ضبط ولالا؟ هات الكود الي يوم تجيب الداتا حق الحساب Link to comment
#Mr.alkmasha Posted December 26, 2014 Author Share Posted December 26, 2014 طيب وش عرفك ان الكود ضبط ولالا؟هات الكود الي يوم تجيب الداتا حق الحساب انا مسوي سيرفر تجريبي و اجرب اطلع و ادخل و ما ينحفض الملابس هات الكود الي يوم تجيب الداتا حق الحساب مو فاهمك يا ريت توضح Link to comment
nxFairlywell Posted December 26, 2014 Share Posted December 26, 2014 (edited) يعني ياطويل العمر انت تطلع وتدخل وش دراك انه حفظ الداتا او لا ؟ __Edit , انت تبيه يحفظ الملابس على حساب اللاعب صح ! جرب هذا الكود addEventHandler("onPlayerQuit", getRootElement( ), function ( ) local Elaccounte = getPlayerAccount( source ) if not ( isGuestAccount( Elaccounte ) and Elaccounte ) then if getElementModel( source ) == 0 then for i = 0, 17 do local clothes, cloth = getPedClothes( source, i ) setAccountData ( Elaccounte, "Clothes", clothes, cloth ) setAccountData( Elaccounte, "IntId", tostring(i) ) end end end end addEventHandler( "onPlayerLogin", getRootElement( ), function( ) local acc = getPlayerAccount( source ) if acc then local c, o = getAccountData ( acc, "Clothes" ) addPedClothes( source, c, o, tonumber( getAccountData( acc, "IntId" ) ) ) end end ) Edited December 26, 2014 by Guest Link to comment
#Mr.alkmasha Posted December 26, 2014 Author Share Posted December 26, 2014 يعني ياطويل العمرانت تطلع وتدخل وش دراك انه حفظ الداتا او لا ؟ لانه الملابس حقي ما ترجع Link to comment
nxFairlywell Posted December 26, 2014 Share Posted December 26, 2014 يعني ياطويل العمرانت تطلع وتدخل وش دراك انه حفظ الداتا او لا ؟ لانه الملابس حقي ما ترجع : مستحيل يعطيك الملابس بدون ماتستخدم الخاصيه addPedClothes getAccountData Link to comment
#Mr.alkmasha Posted December 26, 2014 Author Share Posted December 26, 2014 طيب ليه ما زبط شوف عدلته: addEventHandler('onPlayerQuit',root, -- function() -- local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount(vAcc) then return end for type = 0,17 do texture, model = getPedClothes(source, type) setAccountData(vAcc,'Clothes',model) end end ) addEventHandler('onPlayerLogin',root, function(_,acc) local v_Data = getAccountData(acc,'Clothes') if ( v_Data ) then addPedClothes ( source,v_Data) end end ) Link to comment
TAPL Posted December 26, 2014 Share Posted December 26, 2014 كل الأكواد الي بالموضوع عبارة عن هريس addEventHandler("onPlayerQuit",root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local cTable = {} for i = 0, 17 do local texture, model = getPedClothes(source, i) if texture and model then table.insert(cTable, {texture, model, i}) end end setAccountData(account, "Clothes", toJSON(cTable)) end end) addEventHandler("onPlayerLogin", root, function() if not isPedDead(source) then givePlayerClothes() else addEventHandler("onPlayerSpawn", source, givePlayerClothes) end end) function givePlayerClothes() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local data = getAccountData(account, "Clothes") if (data) then local cTable = fromJSON(data) if cTable and type(cTable) == "table" then local cSkin = getElementModel(source) setElementModel(source, 0) for _, value in ipairs(cTable) do addPedClothes(source, value[1], value[2], value[3]) end setElementModel(source, cSkin) end end end if eventName == "onPlayerSpawn" then removeEventHandler("onPlayerSpawn", source, givePlayerClothes) end end Link to comment
#Mr.alkmasha Posted December 27, 2014 Author Share Posted December 27, 2014 كل الأكواد الي بالموضوع عبارة عن هريس addEventHandler("onPlayerQuit",root, function() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local cTable = {} for i = 0, 17 do local texture, model = getPedClothes(source, i) if texture and model then table.insert(cTable, {texture, model, i}) end end setAccountData(account, "Clothes", toJSON(cTable)) end end) addEventHandler("onPlayerLogin", root, function() if not isPedDead(source) then givePlayerClothes() else addEventHandler("onPlayerSpawn", source, givePlayerClothes) end end) function givePlayerClothes() local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local data = getAccountData(account, "Clothes") if (data) then local cTable = fromJSON(data) if cTable and type(cTable) == "table" then local cSkin = getElementModel(source) setElementModel(source, 0) for _, value in ipairs(cTable) do addPedClothes(source, value[1], value[2], value[3]) end setElementModel(source, cSkin) end end end if eventName == "onPlayerSpawn" then removeEventHandler("onPlayerSpawn", source, givePlayerClothes) end end ما زبط Link to comment
#Mr.alkmasha Posted December 27, 2014 Author Share Posted December 27, 2014 ^شغال 100% لاني جربته وربي ما زبط معاي Link to comment
nxFairlywell Posted December 27, 2014 Share Posted December 27, 2014 كل الأكواد الي بالموضوع عبارة عن هريس ما زبط 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