tigerman Posted June 27, 2011 Posted June 27, 2011 ArmyTeam = {} function NewTeam() ArmyTeam[source] = true end addEventHandler ( "onPlayerSpawn", getRootElement(), NewTeam ) function OldTeam() ArmyTeam[source] = false end addEventHandler ( "onPlayerWasted", getRootElement(), OldTeam ) function FindAllArmyTeamPlayers() for k,v in pairs(ArmyTeam) do local money = getPlayerMoney(v) setPlayerMoney ( v, money+500 ) end end The code should give 500 extra cash to all players who are in army when someone dies VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
JR10 Posted June 27, 2011 Posted June 27, 2011 1. You didn't say what happen it doesn't work? any errors or warnings? 2. Well, why you need to make a table with the army players when we got an awesome team system. https://wiki.multitheftauto.com/wiki/Ser ... _functions 3. we have a function "givePlayerMoney" so you dont have to get the players money and add on it. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
tigerman Posted June 27, 2011 Author Posted June 27, 2011 heh thanks, havent noticed team functions ^^ VIEW MY RESOURCES -> https://forum.mtasa.com/viewtopic.php?f=108&t=70956
JR10 Posted June 27, 2011 Posted June 27, 2011 No problem, now you can use getPlayersInTeam Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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