ايهاب Posted July 31, 2018 Share Posted July 31, 2018 السلام عليكم :))))))) مساعدة مهمة فى مود الريسبون حق اللاعبين المشكلة ان لما اللاعب بيموت بيتغير لى سكن سى جى cj جربت مود ريسبون اخر مع مود حفظ الشخصية كان الامر سليم لكن فى مود الريسبون دة لما اللاعب بيموت بيرسبن وهو معاة سكن سى جى ومركب مود حفظ الشخصية بى اختصار الشخصية ما تتحفظ اية السبب فى المود ان اللاعب اما بيموت بيبقى معاة شخصية سى جى هل فى تعديل تساعدوة ليا cache = {} function saveProperty() local name = getPlayerName(source) -- Get the name if isPedDead(source) then -- Checks if the player is dead. cache[name] = { weapons = false } -- Reset the cache local weaponsTable = {} -- Create a empty table for i=1, 12 do -- Loop the stuff if(getPedWeapon(source, i) ~= 0 and getPedTotalAmmo(source, i) > 0) then table.insert(weaponsTable, getPedWeapon(source, i) .. "." .. getPedTotalAmmo(source, i)) -- Insert into the empty table end end cache[name].weapons = weaponsTable -- Put the empty table in the Cache. else cache[name] = { weapons = false } -- If not then just empty the cache end end addEventHandler("onPlayerWasted", getRootElement(), saveProperty) function loadProperty() local name = getPlayerName(source) -- Get his name if cache[name] and cache[name].weapons then -- Check if there is a cache if cache[name].weapons ~= false then -- Double check local weps = cache[name].weapons for i, node in ipairs(weps) do -- Loop the table local wepinfo = split(node, ".") -- Split the string local wepid = wepinfo[1] local wepammo = wepinfo[2] --setTimer(giveWeapon, i*1000, 1, source, wepid, wepammo ) -- Used for testing giveWeapon ( source, wepid, wepammo ) -- gives the weapon end end end end addEventHandler("onPlayerSpawn", getRootElement(), loadProperty) addEventHandler( "onPlayerWasted", getRootElement( ), function() local x,y,z = getElementPosition(source) if x >= 0 then if y > 590 then setTimer( spawnPlayer, 1000, 1, source, 1606.81115,1821.92810,10.82031 ) else setTimer( spawnPlayer, 1000, 1, source, 1172.71948,-1323.23217,15.40160 ) end else setTimer( spawnPlayer, 1000, 1, source, -2663.66553, 622.27539, 14.45313 ) end end ) Link to comment
!#NssoR_) Posted August 1, 2018 Share Posted August 1, 2018 cache = {} function saveProperty() local x,y,z = getElementPosition(source) local name = getPlayerName(source) -- Get the name if isPedDead(source) then -- Checks if the player is dead. cache[name] = { weapons = false, skin = false } -- Reset the cache local weaponsTable = {} -- Create a empty table for i= 1, 12 do -- Loop the stuff if(getPedWeapon(source, i) ~= 0 and getPedTotalAmmo(source, i) > 0) then table.insert(weaponsTable, getPedWeapon(source, i) .. "." .. getPedTotalAmmo(source, i)) -- Insert into the empty table end end cache[name].weapons = weaponsTable -- Put the empty table in the Cache. cache[name].skin = getElementModel(source) else cache[name] = { weapons = false } -- If not then just empty the cache end if x >= 0 then if y > 590 then setTimer( spawnPlayer, 2000, 1, source, 1606.81115,1821.92810,10.82031 ) else setTimer( spawnPlayer, 2000, 1, source, 1172.71948,-1323.23217,15.40160 ) end else setTimer( spawnPlayer, 2000, 1, source, -2663.66553, 622.27539, 14.45313 ) end end addEventHandler("onPlayerWasted", getRootElement(), saveProperty) function loadProperty() local name = getPlayerName(source) -- Get his name if cache[name] and cache[name].weapons then -- Check if there is a cache if cache[name].weapons ~= false then -- Double check local weps = cache[name].weapons for i, node in ipairs(weps) do -- Loop the table local wepinfo = split(node, ".") -- Split the string local wepid = wepinfo[1] local wepammo = wepinfo[2] --setTimer(giveWeapon, i*1000, 1, source, wepid, wepammo ) -- Used for testing giveWeapon ( source, wepid, wepammo ) -- gives the weapon setElementModel(source,( cache[name].skin or 0)) end end end end addEventHandler("onPlayerSpawn", getRootElement(), loadProperty) 1 Link to comment
SycroX Posted August 1, 2018 Share Posted August 1, 2018 8 hours ago, ايهاب said: السلام عليكم :))))))) مساعدة مهمة فى مود الريسبون حق اللاعبين المشكلة ان لما اللاعب بيموت بيتغير لى سكن سى جى cj جربت مود ريسبون اخر مع مود حفظ الشخصية كان الامر سليم لكن فى مود الريسبون دة لما اللاعب بيموت بيرسبن وهو معاة سكن سى جى ومركب مود حفظ الشخصية بى اختصار الشخصية ما تتحفظ اية السبب فى المود ان اللاعب اما بيموت بيبقى معاة شخصية سى جى هل فى تعديل تساعدوة ليا cache = {} function saveProperty() local name = getPlayerName(source) -- Get the name if isPedDead(source) then -- Checks if the player is dead. cache[name] = { weapons = false } -- Reset the cache local weaponsTable = {} -- Create a empty table for i=1, 12 do -- Loop the stuff if(getPedWeapon(source, i) ~= 0 and getPedTotalAmmo(source, i) > 0) then table.insert(weaponsTable, getPedWeapon(source, i) .. "." .. getPedTotalAmmo(source, i)) -- Insert into the empty table end end cache[name].weapons = weaponsTable -- Put the empty table in the Cache. else cache[name] = { weapons = false } -- If not then just empty the cache end end addEventHandler("onPlayerWasted", getRootElement(), saveProperty) function loadProperty() local name = getPlayerName(source) -- Get his name if cache[name] and cache[name].weapons then -- Check if there is a cache if cache[name].weapons ~= false then -- Double check local weps = cache[name].weapons for i, node in ipairs(weps) do -- Loop the table local wepinfo = split(node, ".") -- Split the string local wepid = wepinfo[1] local wepammo = wepinfo[2] --setTimer(giveWeapon, i*1000, 1, source, wepid, wepammo ) -- Used for testing giveWeapon ( source, wepid, wepammo ) -- gives the weapon end end end end addEventHandler("onPlayerSpawn", getRootElement(), loadProperty) addEventHandler( "onPlayerWasted", getRootElement( ), function() local x,y,z = getElementPosition(source) if x >= 0 then if y > 590 then setTimer( spawnPlayer, 1000, 1, source, 1606.81115,1821.92810,10.82031 ) else setTimer( spawnPlayer, 1000, 1, source, 1172.71948,-1323.23217,15.40160 ) end else setTimer( spawnPlayer, 1000, 1, source, -2663.66553, 622.27539, 14.45313 ) end end ) تحفظه علي اسم اللاعب ؟؟ افرض الاعب غير اسمه بيروح كل شي معه لهيك افضل شي احفظو علي الأكونت او السريال 1 Link to comment
ايهاب Posted August 1, 2018 Author Share Posted August 1, 2018 5 hours ago, #َxLysandeR said: تحفظه علي اسم اللاعب ؟؟ افرض الاعب غير اسمه بيروح كل شي معه لهيك افضل شي احفظو علي الأكونت او السريال هشوف الموضوع دة شكرا للتوضيح 10 hours ago, !#NssoR_) said: cache = {} function saveProperty() local x,y,z = getElementPosition(source) local name = getPlayerName(source) -- Get the name if isPedDead(source) then -- Checks if the player is dead. cache[name] = { weapons = false, skin = false } -- Reset the cache local weaponsTable = {} -- Create a empty table for i= 1, 12 do -- Loop the stuff if(getPedWeapon(source, i) ~= 0 and getPedTotalAmmo(source, i) > 0) then table.insert(weaponsTable, getPedWeapon(source, i) .. "." .. getPedTotalAmmo(source, i)) -- Insert into the empty table end end cache[name].weapons = weaponsTable -- Put the empty table in the Cache. cache[name].skin = getElementModel(source) else cache[name] = { weapons = false } -- If not then just empty the cache end if x >= 0 then if y > 590 then setTimer( spawnPlayer, 2000, 1, source, 1606.81115,1821.92810,10.82031 ) else setTimer( spawnPlayer, 2000, 1, source, 1172.71948,-1323.23217,15.40160 ) end else setTimer( spawnPlayer, 2000, 1, source, -2663.66553, 622.27539, 14.45313 ) end end addEventHandler("onPlayerWasted", getRootElement(), saveProperty) function loadProperty() local name = getPlayerName(source) -- Get his name if cache[name] and cache[name].weapons then -- Check if there is a cache if cache[name].weapons ~= false then -- Double check local weps = cache[name].weapons for i, node in ipairs(weps) do -- Loop the table local wepinfo = split(node, ".") -- Split the string local wepid = wepinfo[1] local wepammo = wepinfo[2] --setTimer(giveWeapon, i*1000, 1, source, wepid, wepammo ) -- Used for testing giveWeapon ( source, wepid, wepammo ) -- gives the weapon setElementModel(source,( cache[name].skin or 0)) end end end end addEventHandler("onPlayerSpawn", getRootElement(), loadProperty) شكرا لتقديم المساعدة يانصور لكن لى الاسف مشتغلشى لكن هناك شخص اعرفة قام بتعديلة ليا واشتغل بقى يحفظ السكن ضاف علية اشياء ضاف علية الكود دة بس مشكور على تعديلك addEventHandler( 'onPlayerWasted', root, function( ) setElementData( source, 'Model', getElementModel( source ) ) end ) addEventHandler( 'onPlayerSpawn', root, function( ) setElementModel( source, ( getElementData( source, 'Model' ) or getElementModel( source ) ) ) end ) Link to comment
TOUNSI |, السعأدة Posted August 1, 2018 Share Posted August 1, 2018 لو معجبوك اخي الكريم اكواد او تبي فكرةة ثانية تواصل معي خاص 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