Jump to content

bosslorenz

Members
  • Posts

    200
  • Joined

  • Last visited

Everything posted by bosslorenz

  1. Working. But takeAllWeapons isnt my request HAHA. I want to load the previous weapon I had onPlayerSpawn
  2. None. Im stucked in spawn. But still doesnt load the function saveAccount
  3. I went to mtawiki onPlayerWasted, and I did everything I know. Im not really good at scripts so hard like this. Can you help me with this please? just this time
  4. function saveAccount( account ) local account = eventName == "onPlayerLogout" and account or getPlayerAccount( source ) if ( account ) and ( not isGuestAccount( account ) ) then local x, y, z = getElementPosition( source ) local _, _, rotation = getElementRotation( source ) local position = { skin = getElementModel( source ), x = x, y = y, z = z, interior = getElementInterior( source ), dimension = getElementDimension( source ), rotation = rotation } local stats = { money = getPlayerMoney( source ), health = getElementHealth( source ), armor = getPedArmor( source ) } local weapons = { } for i = 0, 12 do weapons[ i ] = { weapon = getPedWeapon( source ), ammo = getPedTotalAmmo( source, i ) } end setAccountData( account, "account.position", toJSON( position ) ) setAccountData( account, "account.stats", toJSON( stats ) ) setAccountData( account, "account.weapons", toJSON( weapons ) ) end end addEventHandler( "onPlayerQuit", root, saveAccount ) addEventHandler( "onPlayerWasted", root, saveAccount ) addEventHandler( "onPlayerLogout", root, saveAccount ) addEventHandler( "onPlayerLogin", root, function( _, account ) local position = getAccountData( account, "account.position" ) if ( position ) then position = fromJSON( position ) spawnPlayer( source, position.x, position.y, position.z, position.rotation, position.skin, position.interior, position.dimension ) else spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) end setCameraTarget( source, source ) fadeCamera( source, true, 2.0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end ) function dead( account ) spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end addEventHandler ("onPlayerWasted", root, dead) Still not working. Error: 64:74: Bad argument @ 'getAccountData' [Expected account at argument 1, got number '0']
  5. function saveAccount( account ) local account = eventName == "onPlayerLogout" and account or getPlayerAccount( source ) if ( account ) and ( not isGuestAccount( account ) ) then local x, y, z = getElementPosition( source ) local _, _, rotation = getElementRotation( source ) local position = { skin = getElementModel( source ), x = x, y = y, z = z, interior = getElementInterior( source ), dimension = getElementDimension( source ), rotation = rotation } local stats = { money = getPlayerMoney( source ), health = getElementHealth( source ), armor = getPedArmor( source ) } local weapons = { } for i = 0, 12 do weapons[ i ] = { weapon = getPedWeapon( source ), ammo = getPedTotalAmmo( source, i ) } end setAccountData( account, "account.position", toJSON( position ) ) setAccountData( account, "account.stats", toJSON( stats ) ) setAccountData( account, "account.weapons", toJSON( weapons ) ) end end addEventHandler( "onPlayerQuit", root, saveAccount ) addEventHandler( "onPlayerWasted", root, saveAccount ) addEventHandler( "onPlayerLogout", root, saveAccount ) addEventHandler( "onPlayerLogin", root, function( _, account ) local position = getAccountData( account, "account.position" ) if ( position ) then position = fromJSON( position ) spawnPlayer( source, position.x, position.y, position.z, position.rotation, position.skin, position.interior, position.dimension ) else spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) end setCameraTarget( source, source ) fadeCamera( source, true, 2.0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end ) This script from myonlake really works. But only applies to onPlayerLogin. Theres too many error when I copy the onPlayerLogin and change to onPlayerWasted. Really mess up and many errordebug
  6. function saveAccount( account ) local account = eventName == "onPlayerLogout" and account or getPlayerAccount( source ) if ( account ) and ( not isGuestAccount( account ) ) then local x, y, z = getElementPosition( source ) local _, _, rotation = getElementRotation( source ) local position = { skin = getElementModel( source ), x = x, y = y, z = z, interior = getElementInterior( source ), dimension = getElementDimension( source ), rotation = rotation } local stats = { money = getPlayerMoney( source ), health = getElementHealth( source ), armor = getPedArmor( source ) } local weapons = { } for i = 0, 12 do weapons[ i ] = { weapon = getPedWeapon( source ), ammo = getPedTotalAmmo( source, i ) } end setAccountData( account, "account.position", toJSON( position ) ) setAccountData( account, "account.stats", toJSON( stats ) ) setAccountData( account, "account.weapons", toJSON( weapons ) ) end end addEventHandler( "onPlayerQuit", root, saveAccount ) addEventHandler( "onPlayerWasted", root, saveAccount ) addEventHandler( "onPlayerLogout", root, saveAccount ) addEventHandler( "onPlayerLogin", root, function( _, account ) local position = getAccountData( account, "account.position" ) if ( position ) then position = fromJSON( position ) spawnPlayer( source, position.x, position.y, position.z, position.rotation, position.skin, position.interior, position.dimension ) else spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) end setCameraTarget( source, source ) fadeCamera( source, true, 2.0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end ) addEventHandler( "onPlayerWasted", root, function( _, account ) local position = getAccountData( account, "account.position" ) if ( position ) then position = fromJSON( position ) spawnPlayer( source, position.x, position.y, position.z, position.rotation, position.skin, position.interior, position.dimension ) else spawnPlayer( source, 2485, -1665, 13.5, 0, 0, 0, 0 ) end setCameraTarget( source, source ) fadeCamera( source, true, 2.0 ) local stats = getAccountData( account, "account.stats" ) if ( stats ) then stats = fromJSON( stats ) setElementHealth( source, stats.health ) setPedArmor( source, stats.armor ) setPlayerMoney( source, stats.money ) end local weapons = getAccountData( account, "account.weapons" ) if ( weapons ) then weapons = fromJSON( weapons ) for i, data in pairs( weapons ) do giveWeapon( source, data.weapon, data.ammo, false ) end end end ) Ive added an event where onPlayerWasted happens. But doesnt still load weapons, skins. etc. Error :62: 75: 85: Bad Argument @ 'getAccountData' [Expected account at argument 1, got ped]
  7. Does anyone know where can I find a resource of weapon shop? Where you can buy separate Weapon and Ammo for it. For example, when you dont have the weapon M4, and buy an ammo for it, it doesnt allow you to buy ammo.
  8. Thanks myonlake. But onPlayerWasted, when spawning it doesnt save previous SKIN, WEAPON. It keeps spawning with skin CJ
  9. x= 2485, y= -1665, z= 13.5 And also when the player dies it spawns in that location and load previous weapons, skins.
  10. Still shows this error when a newly registered accounts logged in. And doesnt spawn exactly on spawnPlayer coordinates.
  11. function onQuit(quitType, reason, resposibleElement) if not (isGuestAccount(getPlayerAccount(source))) then local account = getPlayerAccount(source) if (account) then local x, y, z = getElementPosition(source) setAccountData(account, "s.HandMoney", tostring(getPlayerMoney(source))) setAccountData(account, "s.skin", tostring(getPedSkin(source))) setAccountData(account , "s.health", tostring(getElementHealth(source))) setAccountData(account, "s.armor", tostring(getPedArmor(source))) setAccountData(account, "s.x", x) setAccountData(account, "s.y", y) setAccountData(account, "s.z", z) setAccountData(account, "s.int", getElementInterior(source)) setAccountData(account, "s.dim", getElementDimension(source)) setAccountData(account, "s.rot", getElementRotation(source)) setAccountData(account, "s.weap0", getPedWeapon(source, 0)) setAccountData(account, "s.weap1", getPedWeapon(source, 1)) setAccountData(account, "s.weap2", getPedWeapon(source, 2)) setAccountData(account, "s.weap3", getPedWeapon(source, 3)) setAccountData(account, "s.weap4", getPedWeapon(source, 4)) setAccountData(account, "s.weap5", getPedWeapon(source, 5)) setAccountData(account, "s.weap6", getPedWeapon(source, 6)) setAccountData(account, "s.weap7", getPedWeapon(source, 7)) setAccountData(account, "s.weap8", getPedWeapon(source, -- s8) -->) setAccountData(account, "s.weap9", getPedWeapon(source, 9)) setAccountData(account, "s.weap10", getPedWeapon(source, 10)) setAccountData(account, "s.weap11", getPedWeapon(source, 11)) setAccountData(account, "s.weap12", getPedWeapon(source, 12)) setAccountData(account, "s.ammo0", getPedTotalAmmo(source, 0)) setAccountData(account, "s.ammo1", getPedTotalAmmo(source, 1)) setAccountData(account, "s.ammo2", getPedTotalAmmo(source, 2)) setAccountData(account, "s.ammo3", getPedTotalAmmo(source, 3)) setAccountData(account, "s.ammo4", getPedTotalAmmo(source, 4)) setAccountData(account, "s.ammo5", getPedTotalAmmo(source, 5)) setAccountData(account, "s.ammo6", getPedTotalAmmo(source, 6)) setAccountData(account, "s.ammo7", getPedTotalAmmo(source, 7)) setAccountData(account, "s.ammo8", getPedTotalAmmo(source, -- s8) -->) setAccountData(account, "s.ammo9", getPedTotalAmmo(source, 9)) setAccountData(account, "s.ammo10", getPedTotalAmmo(source, 10)) setAccountData(account, "s.ammo11", getPedTotalAmmo(source, 11)) setAccountData(account, "s.ammo12", getPedTotalAmmo(source, 12)) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) addEventHandler("onPlayerWasted", getRootElement(), onQuit) function onLogin(thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount(getPlayerAccount(source))) then local accountData = getAccountData(theCurrentAccount, "s.HandMoney") if (accountData) then local playerMoney = getAccountData(theCurrentAccount, "s.HandMoney") local playerSkin = getAccountData(theCurrentAccount, "s.skin") local playerHealth = getAccountData(theCurrentAccount, "s.health") local playerArmor = getAccountData(theCurrentAccount, "s.armor") local playerX = getAccountData(theCurrentAccount, "s.x") local playerY = getAccountData(theCurrentAccount, "s.y") local playerZ = getAccountData(theCurrentAccount, "s.z") local playerRot = getAccountData(theCurrentAccount, "s.rot") local playerInt = getAccountData(theCurrentAccount, "s.int") local playerDim = getAccountData(theCurrentAccount, "s.dim") local weap0 = getAccountData(theCurrentAccount, "s.weap0") local weap1 = getAccountData(theCurrentAccount, "s.weap1") local weap2 = getAccountData(theCurrentAccount, "s.weap2") local weap3 = getAccountData(theCurrentAccount, "s.weap3") local weap4 = getAccountData(theCurrentAccount, "s.weap4") local weap5 = getAccountData(theCurrentAccount, "s.weap5") local weap6 = getAccountData(theCurrentAccount, "s.weap6") local weap7 = getAccountData(theCurrentAccount, "s.weap7") local weap8 = getAccountData(theCurrentAccount, "s.weap8") local weap9 = getAccountData(theCurrentAccount, "s.weap9") local weap10 = getAccountData(theCurrentAccount, "s.weap10") local weap11 = getAccountData(theCurrentAccount, "s.weap11") local weap12 = getAccountData(theCurrentAccount, "s.weap12") local ammo0 = getAccountData(theCurrentAccount, "s.ammo0") local ammo1 = getAccountData(theCurrentAccount, "s.ammo1") local ammo2 = getAccountData(theCurrentAccount, "s.ammo2") local ammo3 = getAccountData(theCurrentAccount, "s.ammo3") local ammo4 = getAccountData(theCurrentAccount, "s.ammo4") local ammo5 = getAccountData(theCurrentAccount, "s.ammo5") local ammo6 = getAccountData(theCurrentAccount, "s.ammo6") local ammo7 = getAccountData(theCurrentAccount, "s.ammo7") local ammo8 = getAccountData(theCurrentAccount, "s.ammo8") local ammo9 = getAccountData(theCurrentAccount, "s.ammo9") local ammo10 = getAccountData(theCurrentAccount, "s.ammo10") local ammo11 = getAccountData(theCurrentAccount, "s.ammo11") local ammo12 = getAccountData(theCurrentAccount, "s.ammo12") setPlayerMoney(source, playerMoney) setElementHealth(source, playerHealth) setPedArmor(source, playerArmor) spawnPlayer(source, playerX, playerY, playerZ+1, playerRot, playerSkin, playerInt, playerDim) fadeCamera(source, true, 2.0) setCameraTarget(source, source) giveWeapon(source, weap0, ammo0, true) giveWeapon(source, weap1, ammo1, false) giveWeapon(source, weap2, ammo2, false) giveWeapon(source, weap3, ammo3, false) giveWeapon(source, weap4, ammo4, false) giveWeapon(source, weap5, ammo5, false) giveWeapon(source, weap6, ammo6, false) giveWeapon(source, weap7, ammo7, false) giveWeapon(source, weap8, ammo8, false) giveWeapon(source, weap9, ammo9, false) giveWeapon(source, weap10, ammo10, false) giveWeapon(source, weap11, ammo11, false) giveWeapon(source, weap12, ammo12, false) else spawnPlayer(source, 2485, -1665, 13.5, 0, 0, 0, 0) fadeCamera(source, true, 2.0) setCameraTarget(source, source) end end end addEventHandler("onPlayerLogin", getRootElement(), onLogin) Still shows this error when a newly registered accounts logged in. And doesnt spawn exactly on spawnPlayer coordinates.
  12. How come your codes works fine when your function is called onLogout. But on your addEventHandlers is function onQuit? You didnt even create a function onQuit? LOL
  13. Enargy`s script is better. But, the location where it always spawns me when using newbie accounts is in LOS SANTOS NORTH-WEST in the farm. The weird thing is, I`m beneath the ground. Errors: 83 - 95 : Bad Argument @ 'giveWeapon' [Expected weapon-type at argument 2, got boolean. And it does not also spawn me to the exact coordinates I put in spawnPlayer.
  14. And also , the location where it always spawns me when using newbie accounts is in LOS SANTOS NORTH-WEST in the farm. The weird thing is, I`m beneath the ground
  15. function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source ) ) setAccountData (playeraccount, "s.skin", tostring (getPedSkin (source))) setAccountData (playeraccount, "s.x", x) setAccountData (playeraccount, "s.y", y) setAccountData (playeraccount, "s.z", z) setAccountData (playeraccount, "s.int", getElementInterior (source)) setAccountData (playeraccount, "s.dim", getElementDimension (source)) setAccountData (playeraccount, "s.rot", getPedRotation (source)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") if playerInt and playerDim and playerSkin and playerX and playerY and playerZ and playerRot then spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) else spawnPlayer(source, 2485, -1665, 13.5, 0, 0, 0, 0, 0) end spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) end end ) Errors: 83 - 95 : Bad Argument @ 'giveWeapon' [Expected weapon-type at argument 2, got boolean. And it does not also spawn me to the exact coordinates I put in spawnPlayer.
  16. function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source ) ) setAccountData (playeraccount, "s.skin", tostring (getPedSkin (source))) setAccountData (playeraccount, "s.x", x) setAccountData (playeraccount, "s.y", y) setAccountData (playeraccount, "s.z", z) setAccountData (playeraccount, "s.int", getElementInterior (source)) setAccountData (playeraccount, "s.dim", getElementDimension (source)) setAccountData (playeraccount, "s.rot", getPedRotation (source)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) end end ) I have this script which saves weapon, skin, location, etc. How can I add a spawnpoint for new registered players which dont spawn old accounts there,?
  17. exports.scoreboard:addScoreboardColumn('Zombie Kills') addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) givePlayerMoney(killer, 10) addPlayerZombieKills(killer) end) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie Kills") if not zombieKills then setAccountData(account,"Zombie Kills",0) end setAccountData(account,"Zombie Kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie Kills") if zombieKills then setElementData(source,"Zombie Kills",tostring(zombieKills)) else setElementData(source,"Zombie Kills",0) end end) Theres no problem in debug, but it does not update the scoreboard. Scoreboard is just updating when player reconnects. How can I update the zombie kills scoreboard just like in 5 secs.
  18. Thanks for your helps. I`ve found other solution . https://forum.multitheftauto.com/viewtop ... 08&t=27611
  19. Does anyone know the script for save weapon per account?
  20. And for the map voting? How can I import that map voting to my folder?
  21. Thanks for the help JR10. I `ll ask again if theres a problem .
×
×
  • Create New...