abu5lf Posted March 13, 2012 Share Posted March 13, 2012 (edited) I do not know that I work Can you help me I want to kick ban Actions mute slap 100 and so on Example: player id> = I have worked on shows that id as a chat before the player's name Edited December 25, 2012 by Guest Link to comment
Castillo Posted March 14, 2012 Share Posted March 14, 2012 If you want to kick players by their "ID", you'll have to modify the admin panel. Link to comment
abu5lf Posted March 14, 2012 Author Share Posted March 14, 2012 (edited) If you want to kick players by their "ID", you'll have to modify the admin panel. I do not want to just kick I want some other actions How can I modify the admin panel Edited December 25, 2012 by Guest Link to comment
Castillo Posted March 14, 2012 Share Posted March 14, 2012 You should create a function like: getPlayerByID ( theID ) and then implement it on the admin panel. Link to comment
abu5lf Posted March 14, 2012 Author Share Posted March 14, 2012 It is very hard, I do not know the Link to comment
Castillo Posted March 14, 2012 Share Posted March 14, 2012 Well, then I suggest to do easier things first. Link to comment
abu5lf Posted March 14, 2012 Author Share Posted March 14, 2012 Well, then I suggest to do easier things first. I do not think anyone can do it Link to comment
Castillo Posted March 14, 2012 Share Posted March 14, 2012 Of course it can be done, but we're not going to do it for you . Link to comment
abu5lf Posted March 14, 2012 Author Share Posted March 14, 2012 I tried in the following function IDPlayer ( sourcePlayer ) local getPlayerByID = getElementData(theID, source, "ID") or 1 end Link to comment
Kenix Posted March 14, 2012 Share Posted March 14, 2012 You should read it https://wiki.multitheftauto.com/wiki/Scr ... troduction Link to comment
bandi94 Posted March 14, 2012 Share Posted March 14, 2012 command : /kick id (ex. /kick 1) function kickPlayerHandler ( sourcePlayer,cmd,id ) local kicked= getPlayerFromID(id) if ( hasObjectPermissionTo ( sourcePlayer, "function.kickPlayer" ) ) then kickPlayer(kicked) end end addCommandHandler ( "kick", kickPlayerHandler ) function getPlayerFromID(who) for i,v in pairs">pairs(getElementsByType("player") )do if getElementData(v,"ID")==who then return v end end end Link to comment
abu5lf Posted March 15, 2012 Author Share Posted March 15, 2012 local optimize = true local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() for k, v in ipairs">ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs">ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false 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