infection99 Posted March 22, 2014 Share Posted March 22, 2014 Hello guys, I'm making shooter server and I wanted to ask how I can add money prize for every place like "14th=200$" and how I can add money collumn in the scoreboard. I'm still new in LUA so as first I wanted to ask here for any solution. Link to comment
Swatrat Posted March 23, 2014 Share Posted March 23, 2014 Bump. I need help for this too. Link to comment
Dealman Posted March 23, 2014 Share Posted March 23, 2014 You can use setAccountData and getAccountData to permanently store data. Most of the time, you'll probably want to go with SQL if that is a possibility. If not, account data will do fine. Link to comment
.:HyPeX:. Posted March 23, 2014 Share Posted March 23, 2014 Its very easy, i'll divide it into parts: Adding scoreboard column: https://wiki.multitheftauto.com/wiki/Scoreboard Setting Money: Pretty something like onPlayerWasted should do: function PlayerWasted() local DeadPlayers = #getDeadPlayers() local Prize = DeadPlayers * 100 end addEventHandler("onPlayerWasted", getRootElement(), PlayerWasted) Link to comment
Swatrat Posted March 23, 2014 Share Posted March 23, 2014 So "local Prize = DeadPlayers * 100" is like the first will get 100 and the others will get lower and lower right? Link to comment
.:HyPeX:. Posted March 23, 2014 Share Posted March 23, 2014 So "local Prize = DeadPlayers * 100" is like the first will get 100 and the others will get lower and lower right? No, For every dead player The actual one will get 100 money. (Source in this case). If there 10 players online: 5 died, the player who ends 5ths will get 500$. If you end first, you earn 1000$. (100 * 10) Link to comment
Swatrat Posted March 23, 2014 Share Posted March 23, 2014 Ohh, now I understand. I will try it tomorrow because its too late here. Thanks bro! Link to comment
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