MiniGoveya Posted March 26, 2011 Share Posted March 26, 2011 Which functions could I use to make the !admins function?? Link to comment
Moderators Citizen Posted March 26, 2011 Moderators Share Posted March 26, 2011 Hi, What do you mean ? What are the "!admins" functions ? Link to comment
proracer Posted March 26, 2011 Share Posted March 26, 2011 There's an example with DX Drawings which is harder: https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup Now that was a hint and now try to script yourself. Link to comment
MiniGoveya Posted March 26, 2011 Author Share Posted March 26, 2011 @Citizen If I write in chatbox !admins there say Level 1: Citizen Level 5: proracer Level 10: MiniGoveya.<3 etc.. @proracer Thank you Btw, just need that? Link to comment
proracer Posted March 26, 2011 Share Posted March 26, 2011 Yes, example #2 on that function is about showing admins online with DX Drawing. Link to comment
Moderators Citizen Posted March 26, 2011 Moderators Share Posted March 26, 2011 Oh ok I see but it's /admins instead of !admins Link to comment
proracer Posted March 26, 2011 Share Posted March 26, 2011 @CitizeN: Some players are old-school from MTA Race and they like ' ! ' commands instead with ' / ' So they like to script commands with ' ! ' Link to comment
Moderators Citizen Posted March 26, 2011 Moderators Share Posted March 26, 2011 lol ok I never knew that Link to comment
Castillo Posted March 27, 2011 Share Posted March 27, 2011 Well, firstly, you need to create your ACL groups, Admin1, Admin2, etc, and then you can easily script this. Level10list = "" Level9list = "" Level8list = "" Level7list = "" function createAdminList() Level10list = "" Level9list = "" Level8list = "" Level7list = "" for k, v in ipairs(getElementsByType("player")) do if not isGuestAccount(getPlayerAccount(v)) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin")) then Level10list = Level10list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin9")) then Level9list = Level9list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin8")) then Level8list = Level8list .. " " .. getPlayerName(v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Admin7")) then Level7list = Level7list .. " " .. getPlayerName(v) end end end end function adminList(sourcePlayer) createAdminList() if (Level10list == "") then outputChatBox("There is no level 10 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 10 : " .. tostring(Level10list), getRootElement (), 255, 255, 0, true) end if (Level9list == "") then outputChatBox("There is no level 9 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 9 : " .. tostring(Level9list), getRootElement (), 255, 255, 0, true) end if (Level8list == "") then outputChatBox("There is no level 8 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 8 : " .. tostring(Level8list), getRootElement (), 255, 255, 0, true) end if (Level7list == "") then outputChatBox("There is no level 7 Admins !", sourcePlayer, 255, 0, 0 ) else outputChatBox("Admins Level 7 : " .. tostring(Level7list), getRootElement (), 255, 255, 0, true) end end function checkCommand ( message, messageType ) if ( messageType == 0 ) then if ( message == "!admins" ) then setTimer( adminList, 100, 1, source ) end end end addEventHandler ( "onPlayerChat", getRootElement(), checkCommand ) Should work, it is server side. Link to comment
MiniGoveya Posted March 30, 2011 Author Share Posted March 30, 2011 Oooohh thank you bro! Hey, shouldn't I delete this things? "resource.BaseMode" /> "resource.admin" /> "resource.webadmin" /> Or should I put it on every new acl? let me know because I don't understand that part. I ask this because this acl don't have nothing of that: "SuperModerator"> "Moderator" /> "SuperModerator" /> Link to comment
Castillo Posted March 30, 2011 Share Posted March 30, 2011 Create new empty acl(s), and leave that only on most powerfull one. Link to comment
MiniGoveya Posted March 31, 2011 Author Share Posted March 31, 2011 Sorry for double post, If I have a script called, "mta.zip" and I want that admins level X can use it I must add on acl of this admin group this line: "resource.mta.zip" /> ??? Link to comment
Castillo Posted March 31, 2011 Share Posted March 31, 2011 No, also that fails, it doesn't contains ".zip" because it could be a folder, is your script a command? Link to comment
MiniGoveya Posted March 31, 2011 Author Share Posted March 31, 2011 yea.. its a command but its in a folder. EDIT: So it mut be object name="resource.mta" ??? EDIT2: Is there any way to put whole the resources for admin levels on 1 folder? and make it for files instead of millions of folders? Link to comment
Castillo Posted March 31, 2011 Share Posted March 31, 2011 Lol, of course, every resource can have as many scripts as you want, and you don't need a new folder for every .lua script o,o. P.S: Show me your "command" script. Link to comment
MiniGoveya Posted March 31, 2011 Author Share Posted March 31, 2011 Ok I have this lvl 5, he can push himself or others, so here is the code function push( playerSource, command ) player=getLocalPlayer(playerSource) if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) x,y,z=getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.25) end end addCommandHandler ( "push", push ) this is the acl of lvl 5 "Admin5"> "Admin1" /> "Admin2" /> "Admin3" /> "Admin4a" /> "Admin4b" /> "Admin4c" /> "Admin5" /> Link to comment
Castillo Posted March 31, 2011 Share Posted March 31, 2011 This script is server or client side? P.S: you can use this to check if he has rights to use that command, hasObjectPermissionTo Link to comment
MiniGoveya Posted March 31, 2011 Author Share Posted March 31, 2011 Hmm then the code would be: function push( playerSource, command ) player=getLocalPlayer(playerSource) if ( hasObjectPermissionTo ( playerSource, "function.Push", true ) ) then if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) x,y,z=getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.25) end end end addCommandHandler ( "push", push ) ??? P.S.: I think its clients ide EDIT: I really don't know what to put in "function.Push" Link to comment
Castillo Posted March 31, 2011 Share Posted March 31, 2011 function push( playerSource, command ) player=playerSource if ( hasObjectPermissionTo ( playerSource, "command.push", true ) ) then if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) x,y,z=getElementVelocity(vehicle) setElementVelocity ( vehicle, x, y, z+0.25) end end end addCommandHandler ( "push", push ) Then you can add a new command into the ACL in your desired group. Also, you have to move it server side 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