micheal1230 Posted June 25, 2012 Share Posted June 25, 2012 For Example I Mean Like 3600 Is 1 Hour In Seconds But How Can I Set It So If I Typed In /ban Joe 2 it would ban the player for 2 hours function ban(player, command, target, hours, reason) local targetPlayer = getPlayerFromNamePart( target ) local banreason = table.concat({reason}, " ") -- 1 Hour = 3600 Seconds local bantheplayer = banPlayer ( targetPlayer, true, false, true, player, ) if ( hasObjectPermissionTo ( player, "function.aexec" ) ) then Link to comment
Guest Guest4401 Posted June 25, 2012 Share Posted June 25, 2012 (edited) 3600 * hours = seconds. addCommandHandler("ban", function(player,command,target,hours,...) local target = getPlayerFromNamePart(target) local banreason = table.concat({...}, " ") if target then banPlayer(target,true,false,true,player,banreason,(tonumber(hours) or 0)*3600) else outputChatBox('Player not found.',player,255,0,0,false) end end ) Edited June 25, 2012 by Guest4401 Link to comment
micheal1230 Posted June 25, 2012 Author Share Posted June 25, 2012 3600 * seconds = hours. so local banhours = 3600 * hours Link to comment
Guest Guest4401 Posted June 25, 2012 Share Posted June 25, 2012 3600 * seconds = hours. so local banhours = 3600 * hours Did a typing error in hurry. 3600 * hours = seconds Anyway, added the code in my previous post. 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