OrbTanT Posted August 21, 2014 Posted August 21, 2014 Good, this is the first time that I am messing with experience, and I would like to know how can I use the function of resource exp_system Castillo, I have to download the exp_system for using or only export the functions?
OrbTanT Posted August 21, 2014 Author Posted August 21, 2014 I can create the script only exporting functions, or do I have to have the resource of EXP_system
DNL291 Posted August 21, 2014 Posted August 21, 2014 You must use the resource and you can use the exported functions too... Please do not PM me with scripting related question nor support, use the forums instead.
OrbTanT Posted August 21, 2014 Author Posted August 21, 2014 How can I leave on the scoreboard, the value of "Level". exports [ "scoreboard" ]:addScoreboardColumn ( "Level", 4 ) function level ( player, Level ) for index, player in ipairs ( getElementsByType "player" ) do local account = getAccountData ( player ) local Level = 1 local myExp = setAccountData ( account, player) end end MUST have some errors, first time with getAccountData and setAccountData.
Castillo Posted August 21, 2014 Posted August 21, 2014 You must use setElementData. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
OrbTanT Posted August 21, 2014 Author Posted August 21, 2014 Is not working, create a column "level" more does not show the level of the player, right way to use setElementData? exports [ "scoreboard" ]:addScoreboardColumn ( "Level", 4 ) addCommandHandler ( "mylevel", function ( player, theLevel ) for index, player in ipairs ( getElementsByType "player" ) do local account = getAccountData ( player ) local theLevel = 1 local myExp = setAccountData ( account, player) setElementData ( player, "Level", theLevel ) end end )
Castillo Posted August 21, 2014 Posted August 21, 2014 If you are using my resource, then you must create the scoreboard column with data name "level" lowercase. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
OrbTanT Posted August 21, 2014 Author Posted August 21, 2014 Yes I am trying to use, your Resource, more i do not understand very well, how should I use to create the level and exp
OrbTanT Posted August 22, 2014 Author Posted August 22, 2014 How can I save the XPs and LVLs when the player exits the game and load, xp and lvl when you enter. exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function level () for index, player in ipairs ( getElementsByType "player" ) do setElementData( player, "Level", "lvl 1") setElementData( player, "EXP", 0) end end addEventHandler("onPlayerLogin", getRootElement(), level) function levelup (ammo, killer, weapon, bodypart) local XP = getElementData(killer, "EXP") local LVL = getElementData(killer, "Level") if killer and killer ~=source then setElementData(killer, "EXP", tonumber(XP)+10) if tonumber(XP) == 100 then setElementData(killer, "Level", "lvl 2") elseif tonumber(XP) == 200 then setElementData(killer, "Level", "lvl 3") elseif tonumber(XP) == 300 then setElementData(killer, "Level", "lvl 4") elseif tonumber(XP) == 400 then setElementData(killer, "Level", "lvl 5") elseif tonumber(XP) == 500 then setElementData(killer, "Level", "lvl 6") elseif tonumber(XP) == 600 then setElementData(killer, "Level", "lvl 7") elseif tonumber(XP) == 700 then setElementData(killer, "Level", "lvl 8") elseif tonumber(XP) == 800 then setElementData(killer, "Level", "lvl 9") elseif tonumber(XP) == 900 then setElementData(killer, "Level", "lvl 10") end end end addEventHandler("onPlayerWasted", getRootElement(), levelup)
Max+ Posted August 22, 2014 Posted August 22, 2014 How can I save the XPs and LVLs when the player exits the game and load, xp and lvl when you enter. exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function level () for index, player in ipairs ( getElementsByType "player" ) do setElementData( player, "Level", "lvl 1") setElementData( player, "EXP", 0) end end addEventHandler("onPlayerLogin", getRootElement(), level) function levelup (ammo, killer, weapon, bodypart) local XP = getElementData(killer, "EXP") local LVL = getElementData(killer, "Level") if killer and killer ~=source then setElementData(killer, "EXP", tonumber(XP)+10) if tonumber(XP) == 100 then setElementData(killer, "Level", "lvl 2") elseif tonumber(XP) == 200 then setElementData(killer, "Level", "lvl 3") elseif tonumber(XP) == 300 then setElementData(killer, "Level", "lvl 4") elseif tonumber(XP) == 400 then setElementData(killer, "Level", "lvl 5") elseif tonumber(XP) == 500 then setElementData(killer, "Level", "lvl 6") elseif tonumber(XP) == 600 then setElementData(killer, "Level", "lvl 7") elseif tonumber(XP) == 700 then setElementData(killer, "Level", "lvl 8") elseif tonumber(XP) == 800 then setElementData(killer, "Level", "lvl 9") elseif tonumber(XP) == 900 then setElementData(killer, "Level", "lvl 10") end end end addEventHandler("onPlayerWasted", getRootElement(), levelup) I , Just hate when someone's steal My Codes , Why Don't you meak your Own ? - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
xeon17 Posted August 22, 2014 Posted August 22, 2014 How can I save the XPs and LVLs when the player exits the game and load, xp and lvl when you enter. exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function level () for index, player in ipairs ( getElementsByType "player" ) do setElementData( player, "Level", "lvl 1") setElementData( player, "EXP", 0) end end addEventHandler("onPlayerLogin", getRootElement(), level) function levelup (ammo, killer, weapon, bodypart) local XP = getElementData(killer, "EXP") local LVL = getElementData(killer, "Level") if killer and killer ~=source then setElementData(killer, "EXP", tonumber(XP)+10) if tonumber(XP) == 100 then setElementData(killer, "Level", "lvl 2") elseif tonumber(XP) == 200 then setElementData(killer, "Level", "lvl 3") elseif tonumber(XP) == 300 then setElementData(killer, "Level", "lvl 4") elseif tonumber(XP) == 400 then setElementData(killer, "Level", "lvl 5") elseif tonumber(XP) == 500 then setElementData(killer, "Level", "lvl 6") elseif tonumber(XP) == 600 then setElementData(killer, "Level", "lvl 7") elseif tonumber(XP) == 700 then setElementData(killer, "Level", "lvl 8") elseif tonumber(XP) == 800 then setElementData(killer, "Level", "lvl 9") elseif tonumber(XP) == 900 then setElementData(killer, "Level", "lvl 10") end end end addEventHandler("onPlayerWasted", getRootElement(), levelup) I , Just hate when someone's steal My Codes , Why Don't you meak your Own ? Cuz it's easier to steal A unique GangWar gamemode waiting for you!Click here for more information.
Et-win Posted August 22, 2014 Posted August 22, 2014 Cuz it's easier to steal Continue like that and you never will learn. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
xeon17 Posted August 22, 2014 Posted August 22, 2014 Cuz it's easier to steal Continue like that and you never will learn. Keep calm it's just a joke. A unique GangWar gamemode waiting for you!Click here for more information.
-.Paradox.- Posted August 22, 2014 Posted August 22, 2014 exports.scoreboard:scoreboardAddColumn("EXP") exports.scoreboard:scoreboardAddColumn("Level") function levelup (ammo, killer, weapon, bodypart) if (killer and getElementType(killer) == "player" and killer ~= source) then local XP = getElementData(killer, "EXP") or 0 local LVL = getElementData(killer, "Level") or 1 setElementData(killer, "EXP", tonumber(XP)+10) if tonumber(XP) == 100 then setElementData(killer, "Level", 2) elseif tonumber(XP) == 200 then setElementData(killer, "Level", 3) elseif tonumber(XP) == 300 then setElementData(killer, "Level", 4) elseif tonumber(XP) == 400 then setElementData(killer, "Level", 5) elseif tonumber(XP) == 500 then setElementData(killer, "Level", 6) elseif tonumber(XP) == 600 then setElementData(killer, "Level", 7) elseif tonumber(XP) == 700 then setElementData(killer, "Level", 7) elseif tonumber(XP) == 800 then setElementData(killer, "Level", 7) elseif tonumber(XP) == 900 then setElementData(killer, "Level", 10) end end end addEventHandler("onPlayerWasted", getRootElement(), levelup) function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "Level") or 1) setElementData(source, "EXP", getAccountData(account, "EXP") or 0) end addEventHandler ("onPlayerLogin", root, onLogin) function onLogout (_,account) setElementData(source, "Level", 0) setElementData(source, "EXP", 0) end addEventHandler ("onPlayerLogout", root, onLogout) function saveData(thePlayer, theAccount) local theAccount = getPlayerAccount(source) if (theAccount and not isGuestAccount(theAccount)) then setAccountData (theAccount, "Level", getElementData(thePlayer, "Level")) setAccountData (theAccount, "EXP", getElementData(thePlayer, "EXP")) end end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function () saveData(source, getPlayerAccount(source)) end) If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
-.Paradox.- Posted August 22, 2014 Posted August 22, 2014 thanks, Nightfury =) You're welcome If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
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