[YARDIM] Saves Sistemi

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
: 27 Haziran 2018, 23:23:24
Cümleten iyi geceler arkadaşlar 2 3 saves sistemi buldum fakat ölünce hastanede doguyor sonra spawna atıyor ve skin sıfırlanıyor silahlar falan gidiyor play den spawnpointi kaldırdım olmadı saveden spawnpoint kaldırdım saves bozuldu falan kodları paylaşıyorum yardım edebilirmisiniz.

Kod: lua
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
  if  not (isGuestAccount (getPlayerAccount (source))) then
    local accountData = getAccountData (theCurrentAccount, "funmodev2-money")
    if (accountData) then
      local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money")
      local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin")
      local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health")
      local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor")
      local playerX = getAccountData (theCurrentAccount, "funmodev2-x")
      local playerY = getAccountData (theCurrentAccount, "funmodev2-y")
      local playerZ = getAccountData (theCurrentAccount, "funmodev2-z")
      local playerInt = getAccountData (theCurrentAccount, "funmodev2-int")
      local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim")
      local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel")
     local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team")
      local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0")
      local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1")
      local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2")
      local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3")
      local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4")
      local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5")
      local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6")
      local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7")
      local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8")
      local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9")
      local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10")
      local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11")
      local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12")
      local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0")
      local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1")
      local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2")
      local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3")
      local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4")
      local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5")
      local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6")
      local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7")
      local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8")
      local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9")
      local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10")
      local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11")
      local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12")
      spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim)
      setPlayerMoney (source, playerMoney)
      setTimer (setElementHealth, 50, 1, source, playerHealth)
      setTimer (setPedArmor, 50, 1, source, playerArmor)
      setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted)
      giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true)
      giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false)
      giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false)
      giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false)
      giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false)
      giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false)
      giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false)
      giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false)
      giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false)
      giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false)
      giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false)
      giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false)
      giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false)
      setCameraTarget (source, source)
      fadeCamera(source, true, 2.0)
    else
      spawnPlayer (source, 1933.2042236328,1344.4365234375,9.96, 0,0, 0, 0)
      setPlayerMoney (source, 200)
      setCameraTarget (source, source)
      fadeCamera(source, true, 2.0) 
    end   
  end
end
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)

function onLogout ()
kickPlayer (source, nil, "Logging out is disallowed.")
end
addEventHandler ("onPlayerLogout", getRootElement(), onLogout)

function onQuit (quitType, reason, responsibleElement)
  if not (isGuestAccount (getPlayerAccount (source))) then
    account = getPlayerAccount (source)
    if (account) then
      local x,y,z = getElementPosition (source)
      setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source)))
      setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source)))
      setAccountData (account, "funmodev2-health", tostring (getElementHealth (source)))
      setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source)))
      setAccountData (account, "funmodev2-R", r)
      setAccountData (account, "funmodev2-G", g)
      setAccountData (account, "funmodev2-B", b)
      setAccountData (account, "funmodev2-x", x)
      setAccountData (account, "funmodev2-y", y)
      setAccountData (account, "funmodev2-z", z)
      setAccountData (account, "funmodev2-int", getElementInterior (source))
      setAccountData (account, "funmodev2-dim", getElementDimension (source))
      setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source))
      setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0))
      setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1))
      setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2))
      setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3))
      setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4))
      setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5))
      setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6))
      setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7))
      setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, 8))
      setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9))
      setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10))
      setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11))
      setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12))
      setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0))
      setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1))
      setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2))
      setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3))
      setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4))
      setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5))
      setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6))
      setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7))
      setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, 8))
      setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9))
      setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10))
      setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11))
      setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12))
    end
  end
end
addEventHandler ("onPlayerQuit", getRootElement(), onQuit)

function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
    if not( isGuestAccount (getPlayerAccount(source)) ) then
        local theWeapon = getPedWeapon (source)
        local weaponAmmo = getPedTotalAmmo (source)
        local w1 = getPedWeapon (source, 0)
        local w2 = getPedWeapon (source, 1)
        local w3 = getPedWeapon (source, 2)
        local w4 = getPedWeapon (source, 3)
        local w5 = getPedWeapon (source, 4)
        local w6 = getPedWeapon (source, 5)
        local w7 = getPedWeapon (source, 6)
        local w8 = getPedWeapon (source, 7)
        local w9 = getPedWeapon (source, 8)
        local w10 = getPedWeapon (source, 9)
        local w11 = getPedWeapon (source, 10)
        local w12 = getPedWeapon (source, 11)
        local w13 = getPedWeapon (source, 12)
        local a1 = getPedTotalAmmo (source, 0)
        local a2 = getPedTotalAmmo (source, 1)
        local a3 = getPedTotalAmmo (source, 2)
        local a4 = getPedTotalAmmo (source, 3)
        local a5 = getPedTotalAmmo (source, 4)
        local a6 = getPedTotalAmmo (source, 5)
        local a7 = getPedTotalAmmo (source, 6)
        local a8 = getPedTotalAmmo (source, 7)
        local a9 = getPedTotalAmmo (source, 8)
        local a10 = getPedTotalAmmo (source, 9)
        local a11 = getPedTotalAmmo (source, 10)
        local a12 = getPedTotalAmmo (source, 11)
        local a13= getPedTotalAmmo (source, 12)
fadeCamera (source, false)
        setTimer(spawnPlayer,1000,1,source,1933.2042236328,1344.4365234375,9.96, getElementModel(source),0,0,getPlayerTeam(source))
        setTimer(setCameraTarget,1250,1,source, source)
        setTimer(fadeCamera,2000,1,source,true)
        setTimer(giveWeapon,2000,1,source,theWeapon,weaponAmmo, true)
setTimer(giveWeapon,2000,1,source,w1, a1, true)
        setTimer(giveWeapon,2000,1,source,w2, a2, false)
        setTimer(giveWeapon,2000,1,source,w3, a3, false)
        setTimer(giveWeapon,2000,1,source,w4, a4, false)
        setTimer(giveWeapon,2000,1,source,w5, a5, false)
        setTimer(giveWeapon,2000,1,source,w6, a6, false)
        setTimer(giveWeapon,2000,1,source,w7, a7, false)
        setTimer(giveWeapon,2000,1,source,w8, a8, false)
        setTimer(giveWeapon,2000,1,source,w9, a9, false)
        setTimer(giveWeapon,2000,1,source,w10, a10, false)
        setTimer(giveWeapon,2000,1,source,w11, a11, false)
        setTimer(giveWeapon,2000,1,source,w12, a12, false)
        setTimer(giveWeapon,2000,1,source,w13, a13, false)
    end
end
addEventHandler ("onPlayerWasted", getRootElement(), onWasted)

---

function setTeam()
local account = getPlayerAccount(source) -- gets players account
local team = getAccountData (account, "team") -- gets players team
if (team) and getTeamFromName(team) then
      setPlayerTeam(source, getTeamFromName(team)) -- sets players team
     end
end
addEventHandler("onPlayerLogin",root,setTeam) -- sets players team on login
 
function save()
 local team = getPlayerTeam(source) -- Gets the players team
local account = getPlayerAccount(source)
if (team) and not isGuestAccount(account) then -- Checks to see if the player is a guest or not
setAccountData(account, "team", getTeamName(team)) --saves team
 end
    end
addEventHandler("onPlayerQuit", getRootElement(), save) -- saves team on quit
« Son Düzenleme: 28 Haziran 2018, 16:14:11 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Saves Sistemi
« : 27 Haziran 2018, 23:23:24 »

Çevrimdışı KillerHD

  • Yeni Üye
  • *
    • İleti: 56
  • MTA:SA Türkiye Istanbul Gaming
Yanıtla #1 : 28 Haziran 2018, 01:08:09
.
« Son Düzenleme: 16 Şubat 2021, 11:39:38 Gönderen: KillerHD »
 


Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
Yanıtla #2 : 28 Haziran 2018, 08:37:15
Hayır sadece bunu kullanıyorum tamam dogru yerde doguyor fakat ilk önce savedeki kordinata gidiyor sorunsuz sonra play'ın içindekin  broph kordinatına gidiyor skin silah vs sıfırlanmış olarak
 


Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
Yanıtla #3 : 28 Haziran 2018, 09:00:15
Sorun hala devam ediyor bu sefer sıfırlanmış bir şekilde tek kordinata ışınlanıyor

Mesaj Birleştirildi: 28 Haziran 2018, 09:06:45
broph.lua kodları

Kod: lua
local vehiclesToSpawn =
{
}

local spawnpoints =
{
{1933.3161621094,1344.7974853516,9.96,},
}

local vehicleDestroyTimers = {}
local validSkins = {0}
local playerVehicles = {}

local function spawn(player)

if player and isElement(player) then
local x,y,z,r = unpack(spawnpoints[math.random(1,#spawnpoints)])
spawnPlayer(player,x+math.random(-3,3),y+math.random(-3,3),z,r,validSkins[math.random(1,#validSkins)],0,0)
fadeCamera(player, true)
setCameraTarget(player, player)
showChat(player, true)
end

end

local function onJoin()

spawn(source)

end

local function onWasted()

local t = tonumber(get("playerRespawnTime")) or 5000
setTimer(spawn,(t > 50 and t or 50),1,source)

end

local function destroyPlayerVehicles()

local vehicles = playerVehicles[source]

for _,vehicle in ipairs(vehicles) do
if isElement(vehicle) then
destroyElement(vehicle)
end
end

playerVehicles[source] = nil

end

local function onEnter(player)

local t = tonumber(get("vehicleRespawnTime")) or 60000
source.damageProof = false
source.frozen = false
local vehicledata = vehiclesToSpawn[source]
setTimer(createNewVehicle,(t > 50 and t or 50),1,vehicledata)
vehiclesToSpawn[source] = nil
if not playerVehicles[player] then
playerVehicles[player] = {}
addEventHandler("onPlayerQuit",player,destroyPlayerVehicles)
end
table.insert(playerVehicles[player],source)
removeEventHandler("onVehicleEnter",source,onEnter)

end

local function destroyVehicle(vehicle)

if vehicle and isElement(vehicle) and getElementType(vehicle) == "vehicle" then
destroyElement(vehicle)
end

end

local function destroyTimer()

if vehicleDestroyTimers[source] and isTimer(vehicleDestroyTimers[source]) then killTimer(vehicleDestroyTimers[source]) end
removeEventHandler("onVehicleEnter",source,destroyTimer)

end

local function onExit()

local t = tonumber(get("vehicleExpireTime")) or 600000
vehicleDestroyTimers[source] = setTimer(destroyVehicle,(t > 50 and t or 50),1,source)
addEventHandler("onVehicleEnter",source,destroyTimer)

end

function createNewVehicle(vehicledata)

local m,x,y,z,r = unpack(vehicledata)
local vehicle = Vehicle(m,x,y,z,0,0,r)
vehicle.damageProof = true
vehicle.frozen = true
vehiclesToSpawn[vehicle] = vehicledata
addEventHandler("onVehicleEnter",vehicle,onEnter)
addEventHandler("onVehicleExit",vehicle,onExit)

end

local function initScript()

resetMapInfo()
local players = getElementsByType("player")

for _,player in ipairs(players) do spawn(player) end
for _,vehicledata in ipairs(vehiclesToSpawn) do createNewVehicle(vehicledata) end

addEventHandler("onPlayerJoin",root,onJoin)
addEventHandler("onPlayerWasted",root,onWasted)

end

addEventHandler("onResourceStart",resourceRoot,initScript)
« Son Düzenleme: 28 Haziran 2018, 09:06:45 Gönderen: LaykSisTR »
 


Çevrimdışı Paradox

  • Kurucu
  • *
    • İleti: 684
  • SH Gaming
Yanıtla #4 : 28 Haziran 2018, 12:44:33
Böyle dene.
Kod: lua
function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
  if  not (isGuestAccount (getPlayerAccount (source))) then
    local accountData = getAccountData (theCurrentAccount, "funmodev2-money")
    if (accountData) then
      local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money")
      local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin")
      local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health")
      local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor")
      local playerX = getAccountData (theCurrentAccount, "funmodev2-x")
      local playerY = getAccountData (theCurrentAccount, "funmodev2-y")
      local playerZ = getAccountData (theCurrentAccount, "funmodev2-z")
      local playerInt = getAccountData (theCurrentAccount, "funmodev2-int")
      local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim")
      local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel")
     local playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team")
      local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0")
      local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1")
      local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2")
      local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3")
      local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4")
      local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5")
      local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6")
      local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7")
      local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8")
      local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9")
      local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10")
      local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11")
      local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12")
      local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0")
      local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1")
      local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2")
      local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3")
      local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4")
      local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5")
      local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6")
      local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7")
      local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8")
      local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9")
      local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10")
      local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11")
      local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12")
      spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim)
      setPlayerMoney (source, playerMoney)
      setTimer (setElementHealth, 50, 1, source, playerHealth)
      setTimer (setPedArmor, 50, 1, source, playerArmor)
      setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted)
      giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true)
      giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false)
      giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false)
      giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false)
      giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false)
      giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false)
      giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false)
      giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false)
      giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false)
      giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false)
      giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false)
      giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false)
      giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false)
      setCameraTarget (source, source)
      fadeCamera(source, true, 2.0)
    else
      spawnPlayer (source, 1933.2042236328,1344.4365234375,9.96, 0,0, 0, 0)
      setPlayerMoney (source, 200)
      setCameraTarget (source, source)
      fadeCamera(source, true, 2.0) 
    end   
  end
end
addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
 
function onLogout ()
        kickPlayer (source, nil, "Logging out is disallowed.")
end
addEventHandler ("onPlayerLogout", getRootElement(), onLogout)
 
function onQuit (quitType, reason, responsibleElement)
  if not (isGuestAccount (getPlayerAccount (source))) then
    account = getPlayerAccount (source)
    if (account) then
      local x,y,z = getElementPosition (source)
      setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source)))
      setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source)))
      setAccountData (account, "funmodev2-health", tostring (getElementHealth (source)))
      setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source)))
      setAccountData (account, "funmodev2-R", r)
      setAccountData (account, "funmodev2-G", g)
      setAccountData (account, "funmodev2-B", b)
      setAccountData (account, "funmodev2-x", x)
      setAccountData (account, "funmodev2-y", y)
      setAccountData (account, "funmodev2-z", z)
      setAccountData (account, "funmodev2-int", getElementInterior (source))
      setAccountData (account, "funmodev2-dim", getElementDimension (source))
      setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source))
      setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0))
      setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1))
      setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2))
      setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3))
      setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4))
      setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5))
      setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6))
      setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7))
      setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, 8))
      setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9))
      setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10))
      setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11))
      setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12))
      setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0))
      setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1))
      setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2))
      setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3))
      setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4))
      setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5))
      setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6))
      setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7))
      setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, 8))
      setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9))
      setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10))
      setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11))
      setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12))
    end
  end
end
addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
 
function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
    if not( isGuestAccount (getPlayerAccount(source)) ) then
        local theWeapon = getPedWeapon (source)
        local weaponAmmo = getPedTotalAmmo (source)
        local w1 = getPedWeapon (source, 0)
        local w2 = getPedWeapon (source, 1)
        local w3 = getPedWeapon (source, 2)
        local w4 = getPedWeapon (source, 3)
        local w5 = getPedWeapon (source, 4)
        local w6 = getPedWeapon (source, 5)
        local w7 = getPedWeapon (source, 6)
        local w8 = getPedWeapon (source, 7)
        local w9 = getPedWeapon (source, 8)
        local w10 = getPedWeapon (source, 9)
        local w11 = getPedWeapon (source, 10)
        local w12 = getPedWeapon (source, 11)
        local w13 = getPedWeapon (source, 12)
        local a1 = getPedTotalAmmo (source, 0)
        local a2 = getPedTotalAmmo (source, 1)
        local a3 = getPedTotalAmmo (source, 2)
        local a4 = getPedTotalAmmo (source, 3)
        local a5 = getPedTotalAmmo (source, 4)
        local a6 = getPedTotalAmmo (source, 5)
        local a7 = getPedTotalAmmo (source, 6)
        local a8 = getPedTotalAmmo (source, 7)
        local a9 = getPedTotalAmmo (source, 8)
        local a10 = getPedTotalAmmo (source, 9)
        local a11 = getPedTotalAmmo (source, 10)
        local a12 = getPedTotalAmmo (source, 11)
        local a13= getPedTotalAmmo (source, 12)
        setTimer(giveWeapon,5002,1,source,theWeapon,weaponAmmo, true)
                setTimer(giveWeapon,5002,1,source,w1, a1, true)
        setTimer(giveWeapon,5002,1,source,w2, a2, false)
        setTimer(giveWeapon,5002,1,source,w3, a3, false)
        setTimer(giveWeapon,5002,1,source,w4, a4, false)
        setTimer(giveWeapon,5002,1,source,w5, a5, false)
        setTimer(giveWeapon,5002,1,source,w6, a6, false)
        setTimer(giveWeapon,5002,1,source,w7, a7, false)
        setTimer(giveWeapon,5002,1,source,w8, a8, false)
        setTimer(giveWeapon,5002,1,source,w9, a9, false)
        setTimer(giveWeapon,5002,1,source,w10, a10, false)
        setTimer(giveWeapon,5002,1,source,w11, a11, false)
        setTimer(giveWeapon,5002,1,source,w12, a12, false)
        setTimer(giveWeapon,5002,1,source,w13, a13, false)
    end
end
addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
 
---
 
function setTeam()
local account = getPlayerAccount(source) -- gets players account
local team = getAccountData (account, "team") -- gets players team
if (team) and getTeamFromName(team) then
      setPlayerTeam(source, getTeamFromName(team)) -- sets players team
     end
end
addEventHandler("onPlayerLogin",root,setTeam) -- sets players team on login
 
function save()
 local team = getPlayerTeam(source) -- Gets the players team
local account = getPlayerAccount(source)
if (team) and not isGuestAccount(account) then -- Checks to see if the player is a guest or not
setAccountData(account, "team", getTeamName(team)) --saves team
 end
    end
addEventHandler("onPlayerQuit", getRootElement(), save) -- saves team on quit
 


Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
Yanıtla #5 : 28 Haziran 2018, 12:56:16
Malesef Hala aynı silah sıfırlanmıyor ama sadece skin sıfırlanıyor nedense
 


MTASATURK

Ynt: [YARDIM] Saves Sistemi
« Yanıtla #5 : 28 Haziran 2018, 12:56:16 »

Çevrimdışı Mahlukat

  • Uzman Üye
  • *
    • İleti: 637
Yanıtla #6 : 28 Haziran 2018, 14:23:41
Linki görebilmek için Kayıt olun yada Giriş yapın.
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
Yanıtla #7 : 28 Haziran 2018, 16:50:21
Bide buna bakabilirmisiniz ölünce harita çıkıyor sadece skin sıfırlanıyor

Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı KillerHD

  • Yeni Üye
  • *
    • İleti: 56
  • MTA:SA Türkiye Istanbul Gaming
Yanıtla #8 : 28 Haziran 2018, 19:46:34
.
« Son Düzenleme: 16 Şubat 2021, 11:39:32 Gönderen: KillerHD »
 


Çevrimdışı LaykSisTR

  • Yeni Üye
  • *
    • İleti: 9
Yanıtla #9 : 28 Haziran 2018, 19:55:49
Eyvallah kardeşim halloldu