mohammed21999 Posted December 22, 2015 Share Posted December 22, 2015 function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(getPlayerFromName ( players ), false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", adminrules) guys where's the problem here? Link to comment
1LoL1 Posted December 22, 2015 Share Posted December 22, 2015 function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(getPlayerFromName ( players ), false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", adminrules) guys where's the problem here? Try this: function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(thePlayer, false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", adminrules) Link to comment
iMr.Omar Posted December 22, 2015 Share Posted December 22, 2015 try this function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(thePlayer, false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", maintance) -- edit here Link to comment
Enargy, Posted December 22, 2015 Share Posted December 22, 2015 function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(getPlayerFromName ( players ), false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", adminrules) guys where's the problem here? Try this: function maintance () local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do banPlayer(thePlayer, false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", adminrules) You are missing function's parameters. function maintance (thePlayer, command, arg1, arg2) -- You just gonna use thePlayer, does not necessary implement any other. Link to comment
#RooTs Posted December 22, 2015 Share Posted December 22, 2015 maybe this function maintance () for _,v in pairs(getElementsByType("player")) do banPlayer(v, false, false, true, getRootElement(), "banned for maintaince") end end addCommandHandler("maintainceban", maintance) -- edit here Link to comment
Rockyz Posted December 22, 2015 Share Posted December 22, 2015 addCommandHandler ("maintainceban", function (plr) for _, v in ipairs (getElementsByType ("player")) do if (plr and plr ~= v) then banPlayer (v, false, false, true, root, "banned for maintaince") end end end) 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