KainDepZai Posted April 4, 2015 Share Posted April 4, 2015 function createTeam ( source, commandName, teamName, thePlayer ) local money = getPlayerMoney (thePlayer) local newTeam = createTeam ( teamName ) if money >= 888888 and newTeam then takePlayerMoney (thePlayer, 888888) setPlayerTeam ( source, newTeam ) else outputChatBox("Bạn không đủ tiền để tạo nhóm",thePlayer,255,0,0) end end addCommandHandler("createteam", createTeam) Link to comment
WhoAmI Posted April 4, 2015 Share Posted April 4, 2015 function createTeam1 ( source, commandName, teamName, thePlayer ) local money = getPlayerMoney (thePlayer) local newTeam = createTeam ( teamName ) if money >= 888888 and newTeam then takePlayerMoney (thePlayer, 888888) setPlayerTeam ( source, newTeam ) else outputChatBox("Bạn không đủ tiền để tạo nhóm",thePlayer,255,0,0) end end addCommandHandler("createteam", createTeam1) Link to comment
KainDepZai Posted April 4, 2015 Author Share Posted April 4, 2015 can you show why server doesn't take player money ?? Link to comment
WhoAmI Posted April 4, 2015 Share Posted April 4, 2015 function createTeam1 ( thePlayer, commandName, teamName ) local money = getPlayerMoney (thePlayer) local newTeam = createTeam ( teamName ) if money >= 888888 and newTeam then takePlayerMoney (thePlayer, 888888) setPlayerTeam ( thePlayer, newTeam ) else outputChatBox("Bạn không đủ tiền để tạo nhóm",thePlayer,255,0,0) end end addCommandHandler("createteam", createTeam1) Link to comment
KainDepZai Posted April 4, 2015 Author Share Posted April 4, 2015 still create team but not take player money Link to comment
Dimos7 Posted April 4, 2015 Share Posted April 4, 2015 (edited) function createTeaml(thePlayer, commandName, teamName) local money = getPlayerMoney(thePlayer) local newTeam = createTeam(teamName) if money >= 888888 and newTeam then takePlayerMoney(source, 888888) setPlayerTeam(source, newTeam) else outputChatBox("Bạn không đủ tiền để tạo nhóm", thePlayer, 255, 0, 0) end end addCommandHandler("createteam", createTeaml) Edited April 5, 2015 by Guest Link to comment
KainDepZai Posted April 4, 2015 Author Share Posted April 4, 2015 still not take money and still create team Link to comment
Castillo Posted April 4, 2015 Share Posted April 4, 2015 function createTeaml(thePlayer, commandName, teamName) local money = getPlayerMoney(thePlayer) local newTeam = createTeam(teamName) if money >= 888888 and newTeam then takePlayerMoney(source, 888888) setPlayerTeam(source, newTeam) else outputChatBox("Bạn không đủ tiền để tạo nhóm", thePlayer, 255, 0, 0) end end addComandHandler("createteam", createTeaml) It's "addCommandHandler" not "addComandHandler". Link to comment
The Don Posted April 5, 2015 Share Posted April 5, 2015 here we go addCommandHandler('ct', function ( player , cmd , team , r,g,b) if getPlayerMoney ( player ) >= 10000 then takePlayerMoney ( player , 10000 ) theteam = createTeam ( team , r,g,b or 255,255,255 ) setPlayerTeam ( player , theteam ) outputChatBox ( 'Successfully create the team ! '..team..' congrats',player ,0,255,0) else outputChatBox ( 'You dont have enough money',player,255,0,0) end end ) how to use it ./ct teamname colour r g b or 255,255,255 ( white colour ) Link to comment
KainDepZai Posted April 5, 2015 Author Share Posted April 5, 2015 Thanks @دؤن , @Solid Snake , @Dimos7 and @WhoAmI for helping me 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