murilo2929 Posted October 22, 2019 Share Posted October 22, 2019 Alguem poderia me ajudar, como posso fazer para salvar a roupa do cj para que quando o player saia e entre dnv no servidor a roupa seja a mesma que ele saiu. Link to comment
#DeltaSCR Posted October 22, 2019 Share Posted October 22, 2019 getElementModel setAccountData getAccountData setElementModel Link to comment
DNL291 Posted October 22, 2019 Share Posted October 22, 2019 getPedClothes addPedClothes Link to comment
murilo2929 Posted October 23, 2019 Author Share Posted October 23, 2019 3 hours ago, DNL291 said: getPedClothes addPedClothes function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(source,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) tentei assim e não deu amigo Link to comment
VictorScripting Posted October 23, 2019 Share Posted October 23, 2019 8 hours ago, murilo2929 said: function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(source,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) tentei assim e não deu amigo se você quiser te mando uma loja de skin com salvamento aew vc estuda mais se não quiser te mando só as linhas do save !!! Link to comment
murilo2929 Posted October 23, 2019 Author Share Posted October 23, 2019 2 minutes ago, Victor Script said: se você quiser te mando uma loja de skin com salvamento aew vc estuda mais se não quiser te mando só as linhas do save !!! me envie a loja para eu dar uma olhada fazendo favor. Link to comment
VictorScripting Posted October 23, 2019 Share Posted October 23, 2019 https://www.mediafire.com/file/ptmz601xaw6cva0/btc_cjClothes.zip/file aconselho que use um mod de dx e lá onde tá export bote o nome do dxmensage que vc for usar !!!!! Link to comment
murilo2929 Posted October 23, 2019 Author Share Posted October 23, 2019 1 minute ago, Victor Script said: https://www.mediafire.com/file/ptmz601xaw6cva0/btc_cjClothes.zip/file aconselho que use um mod de dx e lá onde tá export bote o nome do dxmensage que vc for usar !!!!! irmão é essa loja que estou usando, e aqui no meu servidor ela não salva lol Link to comment
VictorScripting Posted October 23, 2019 Share Posted October 23, 2019 Just now, murilo2929 said: irmão é essa loja que estou usando, e aqui no meu servidor ela não salva lol n ? pois espera vou ver o meu save system --[[ original script by Justus (GA_Justus) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(source,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(player,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", player, 0, 255, 0) textures = {} models = {} else outputChatBox("Porfavor faça login!", player, 255, 0, 0) end end addCommandHandler("loadClothes", loadClothes) function saveClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(player, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end else outputChatBox("Porfavor faça login!", player, 255, 0, 0) end end addCommandHandler("saveClothes", saveClothes) server !!!!!!! espero ter ajudado !!!!!!!! Link to comment
murilo2929 Posted October 23, 2019 Author Share Posted October 23, 2019 3 minutes ago, Victor Script said: n ? pois espera vou ver o meu save system --[[original script by Justus (GA_Justus)--]]function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} endendaddEventHandler("onPlayerQuit", getRootElement(), saveClothes)function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(source,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0) textures = {} models = {} endendaddEventHandler("onPlayerLogin", getRootElement(), setClothes)function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(player,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", player, 0, 255, 0) textures = {} models = {} else outputChatBox("Porfavor faça login!", player, 255, 0, 0) endendaddCommandHandler("loadClothes", loadClothes)function saveClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(player, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end else outputChatBox("Porfavor faça login!", player, 255, 0, 0) endendaddCommandHandler("saveClothes", saveClothes) server !!!!!!! espero ter ajudado !!!!!!!! esse script que eu estava tentando usar para salvar como pode ver ali em cima, mas não funcionou aqui Link to comment
VictorScripting Posted October 23, 2019 Share Posted October 23, 2019 mais vc está usando só ele ? ou no mod tem outros script.Lua ? você ja olhou a debugscript 3 ????????? Link to comment
murilo2929 Posted October 23, 2019 Author Share Posted October 23, 2019 3 minutes ago, Victor Script said: mais vc está usando só ele ? ou no mod tem outros script.Lua ? você ja olhou a debugscript 3 ????????? precisa usar esses comandos? eu estou não estou colocando eles Link to comment
VictorScripting Posted October 23, 2019 Share Posted October 23, 2019 6 minutes ago, murilo2929 said: precisa usar esses comandos? eu estou não estou colocando eles mais tu já olhou a debug? recomendo tu usar o script completo pow ele salva: dinheiro, spawn, wasted, skins, roupas e etc.... recomendo usar ele pow. 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