Jump to content

Need some help.


Recommended Posts

Posted

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. :)

Posted

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.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

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) 
  

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted
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)

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...