iPrestege Posted May 18, 2013 Posted May 18, 2013 Lol solid snake just save and you have to get the data and set it ._. !?
Castillo Posted May 18, 2013 Posted May 18, 2013 Seems like you don't read what I told you, I said that it just SAVES the team, it doesn't LOAD it. With this it'll load it aswell: addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) end setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted May 18, 2013 Author Posted May 18, 2013 (edited) sorry still nothing Edited May 18, 2013 by Guest Skype: Jordan_Nymph
Castillo Posted May 18, 2013 Posted May 18, 2013 No, just copy my last code. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted May 18, 2013 Author Posted May 18, 2013 i did but nothing still local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) end is that end ment to be there Skype: Jordan_Nymph
Castillo Posted May 18, 2013 Posted May 18, 2013 addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) See if it outputs something to chat. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted May 18, 2013 Posted May 18, 2013 It doesn't output to chat: "NO TEAM SAVED"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted May 18, 2013 Author Posted May 18, 2013 no just spawn me with nothing Skype: Jordan_Nymph
Castillo Posted May 18, 2013 Posted May 18, 2013 addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) Try it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted May 18, 2013 Author Posted May 18, 2013 that spawned me with one gun and no team Skype: Jordan_Nymph
mint3d Posted May 18, 2013 Author Posted May 18, 2013 well mines dosent come to my server and check Skype: Jordan_Nymph
Castillo Posted May 18, 2013 Posted May 18, 2013 I just tested it and it works as it should, so you either did something wrong or your server has an script which is conflicting with this one. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
mint3d Posted May 18, 2013 Author Posted May 18, 2013 addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setElementData ( source, "Role", role ) spawnPlayer ( source, x, y, z, interior, dimension ) setElementHealth ( source, health ) setElementModel ( source, skin ) local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end setPlayerMoney ( source, money ) setPedArmor ( source, armor ) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) i have that and meta meta> "Bucky" type="script" version="1.3" description="Wasted save" /> Skype: Jordan_Nymph
iPrestege Posted May 18, 2013 Posted May 18, 2013 addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then for slot = 1, 12 do setAccountData ( account, "save-wep".. slot, getPedWeapon ( source, slot ) ) setAccountData ( account, "save-ammo".. slot, getPedTotalAmmo ( source, slot ) ) end local team = getPlayerTeam ( source ) if ( team ) then setAccountData ( account, "save-team", getTeamName ( team ) ) end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then local team = getTeamFromName ( getAccountData ( account, "save-team" ) ) if ( team ) then setPlayerTeam ( source, team ) else outputChatBox ( "NO TEAM SAVED", source ) end for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end ) Try it. You should use this .
mint3d Posted May 18, 2013 Author Posted May 18, 2013 still nothing and i spawn with more ammo Skype: Jordan_Nymph
mint3d Posted May 18, 2013 Author Posted May 18, 2013 WARNING: wasted-save\wasted-save.lua:30: Bad argument @ 'giveWeapon' [Expected weapon-type at argument 2, got boolean] Skype: Jordan_Nymph
iPrestege Posted May 19, 2013 Posted May 19, 2013 I have a question ..Why are you using the account data when the player wasted? What about a table? Because the account data maybe make some laggy with a wasted event - spawn event .
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