Jump to content

Need Helping Hand with online Admins!!!!


blackberry

Recommended Posts

Hi,im trying to make a script,(edit one)

I want the Script to sort all Admins on each cathegories (admin,moderator....ect)But i im dumb,and i dont know how i could do that.i can make small changes but never all the script...

So when i type /admins

it say:

Online Admins:

Level 10:[player1],[player2]

Level 9:[player3]

Level 8:[player4),[player5]

Up to level 1.....

Oh and i want it to be seen by all the serv(players) when someone type it

I already Created my aclgroup of Levels,i just want to be showed on this ...thanks

-- (/admins)
local admins = ""
 
function processAdminList()
players = getElementsByType ( "player" )
admins = ""
for k,v in ipairs(players) do
local accountname = ""
if (isGuestAccount(getPlayerAccount(v)) == false) then
		accountname = getAccountName (getPlayerAccount(v))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then
if (admins == "") then
				admins = getPlayerName(v)
else
				admins = admins .. ", " .. getPlayerName(v)
end
end
end
end
end
 
addEventHandler( "onPlayerLogin", getRootElement(), processAdminList )
addEventHandler( "onPlayerLogout", getRootElement(), processAdminList )
addEventHandler( "onPlayerQuit", getRootElement(), processAdminList )
 
 
function setAdminList(Player,command)
if admins ~= "" then
outputChatBox("Online Admins:"..admins , getRootElement(),  255 , 255, 0)
else
outputChatBox("No admins online." , getRootElement(),  255 , 255, 0)
end
end
addCommandHandler("admins", setAdminList)
 
--- !admins or !onlineadmins or !Admins
function tAdmins(message,messageType)
if message == "!admins" or message == "!Admins" or message =="!onlineadmins" then
local playeraccount = getPlayerAccount(source)
if admins ~= "" then
outputChatBox("Online Admins: "..admins , getRootElement(), 255 , 255, 0)
else
outputChatBox("No admins online." , getRootElement(), 255 , 255, 0)
end
end
end
addEventHandler("onPlayerChat",getRootElement(),tAdmins)

Thanks a lot

Link to comment
PM me the list of ACL groups that you have, IE:

Owner

Super Admin

Admin

Moderator

BlaBlaBla

And I'll put something together for you.

(I've already written something similar to this, just not released it.)

AS you can see.i made only one level(Level 1) ,you are not obligated to edit it and add up to Level 10...if you want...I just need Level 1,2,3,4,5,6,7,8,9,10

So Admin is named (showed)as 10 ,

Super Moderator name (showed) as 9

Moderator As 8

and all other named (showed) as their level....

Thanks men,i really aprreciate your precious helping hand....

http://pastebin.com/tXgYQYf6

Link to comment

I'm not sure on your intentions but that to me is way too many levels. You only need 5 at the max in my opinion.

I have written the script and uploaded it here:

http://www.mediafire.com/?r79ia8kkpsj5cj4

(PLEASE ENSURE YOU RUN THE TOP 9 LINES OF script.lua BEFORE MAKING USE OF IT)

It's written to include:

Admin (Labelled as Head Administrator)

Super Mod (Labelled as Lead Administrator)

Mod (Labelled as Super Administrator)

Level 1 (Labelled as Administrator)

Edit 1: Decided not to comment it now, it's probably something that you wouldn't manage to do correctly (No offence, but is quite a simple script to write.), just contact me if you need anything extra. (Can't guarantee I'll always help and respond, I'm already a scripter for a community with 3 servers in MTA.)

Regards.

PS: Where will this script be used? (PM me the IP address to the server.)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...