Leinad Raiz Posted November 5, 2021 Share Posted November 5, 2021 Alguem pode me ajudar eu tenho uma gamemode play configurada para o roleplay, Ate ai tudo bem so que o problema e que quando morre o personagem ele volta a skin original do (CJ) Isso fica meio complicado porque elas paga para ter a skin dai quando morrer perde-la seria injusto. Se alguem poder me ajudar estou a quase 4 dias perguntando no forum ninguem me responde! [CLIENT] local spawnpoint addEventHandler("onResourceStart", resourceRoot, function() spawnpoint = getRandomSpawnPoint() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) if not isElement(player) then return end if get("spawnreset") == "onSpawn" then spawnpoint = getRandomSpawnPoint() end exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) repeat until setElementModel(player,math.random(312)) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end function getRandomSpawnPoint () local spawnpoints = getElementsByType("spawnpoint") return spawnpoints[math.random(1,#spawnpoints)] end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerQuit",root, function () if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then spawnpoint = getRandomSpawnPoint() end end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) [SERVER] local joinX = 1481.2946777344 local joinY = -1766.1395263672 local joinZ = 18.795755386353 local joinSkin = 0 -- skin ao entrar no servidor local spawnSkin = 0 -- Skin ao morrer local joinMoney = 3000 -- Dinheiro ao entrar no servidor local spawnX = 2032.3931884766 local spawnY = -1416.2508544922 local spawnZ = 16.9921875 -- Function -- This function spawns players when they join function spawnOnJoin() spawnPlayer(source, joinX, joinY, joinZ, joinSkin) fadeCamera(source, true) setCameraTarget(source, source) givePlayerMoney(source, joinMoney) end function spawnOnDead(killer, bodypart) setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, spawnSkin) setCameraTarget(source, source) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead) Link to comment
The_GTA Posted November 5, 2021 Share Posted November 5, 2021 Hello Leinad Raiz, this seems like a double post. Please respond to my answer in another thread which is about the same issue: Link to comment
Administrators Tut Posted November 5, 2021 Administrators Share Posted November 5, 2021 Closing this as advised above. Please continue to use the Programcao em Lua section for any other scripting questions in Portuguese! Link to comment
Recommended Posts