tigerman Posted June 27, 2011 Share 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 Link to comment
JR10 Posted June 27, 2011 Share 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. Link to comment
tigerman Posted June 27, 2011 Author Share Posted June 27, 2011 heh thanks, havent noticed team functions ^^ Link to comment
JR10 Posted June 27, 2011 Share Posted June 27, 2011 No problem, now you can use getPlayersInTeam 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