Resource:Admin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(13 intermediate revisions by 9 users not shown)
Line 2: Line 2:
A quick tutorial on how to get admin rights and install admin resource.
A quick tutorial on how to get admin rights and install admin resource.


<section name="MTA 1.0.0 and lower" class="server" show="false">
'''Note:''' Since mta 1.0.5 the accounts.xml file has been removed and replaced by sqlite.


At first, open the '''accounts.xml''' file located in '''server\mods\deathmatch\''' and add a line with your account details, like on the following example.
At first, open the '''accounts.xml''' file located in '''server\mods\deathmatch\''' and add a line with your account details, like on the following example.


[[Image:admin_accounts.png]]
<syntaxhighlight lang="xml">    <accounts>
      <autologin>1</autologin>
      <account name="Console" password="" />
      <account name="lil_Toady" password="1234" />
    </accounts>
</syntaxhighlight>
</section>


To add an account in '''MTA {{padleft:|3|{{Current Version|full}}}}''' use the following command in the server
'''Note:''' The server needs to run for this action
<syntaxhighlight lang="lua">
addaccount <username> <password>
</syntaxhighlight>
'''Note:''' Server should not be running when you are editing the acl file below


Then you open the '''acl.xml''' file located in the same folder and add yourself as an object to the Admin group by using the 'user.*' syntax, where * would be your account name.
Then you open the '''acl.xml''' file located in the same folder and add yourself as an object to the Admin group by using the 'user.*' syntax, where * would be your account name.


[[Image:admin_acl.png]]
<syntaxhighlight lang="xml">    <!-- The Admin group can do anything -->
    <group name="Admin">
        <acl name="Moderator" />
        <acl name="SuperModerator" />
        <acl name="Admin" />
        <acl name="RPC" />
        <object name="user.lil_Toady" />
        <object name="resource.admin" />
    </group>
</syntaxhighlight>




Now open your '''mtaserver.conf''' file and scroll to the bottom, make sure the admin resource is added to the ones that start with the server (note: protected="1" means that it can not be stopped).
Now open your '''mtaserver.conf''' file and scroll to the bottom, make sure the admin resource is added to the ones that start with the server (note: protected="1" means that it can not be stopped).


[[Image:admin_mtaserver.png]]
<syntaxhighlight lang="conf">    <resource src="admin" startup="1" protected="0">  <!-- This is -->
    <resource src="helpmanager" startup="1" protected="0">
    <resource src="mapcycler" startup="1" protected="0">
    <resource src="mapmanager" startup="1" protected="0">
</syntaxhighlight>
 


Now that you're done with server files, you can finally start it. Connect to the server itself and login with your account details: use 'login [username] <password>'. If it tells you to press 'p' you have done everything right, congratulations! If not, do this from the very beginning.
[[Category:Scripting Concepts]]


Now that you're done with server files, you can you can finally start it. Connect to the server itself and login with your account details: use 'login [username] <password>'. If it tells you to press 'p' you have done everything right, congratulations! If not, do this from the very beginning.
[[hu:Resource:Admin]]
[[it:Resource:Admin]]
[[ru:Resource:Admin]]

Revision as of 20:56, 25 December 2018

A quick tutorial on how to get admin rights and install admin resource.

Click to expand [+]
MTA 1.0.0 and lower

To add an account in MTA 1.6 use the following command in the server

Note: The server needs to run for this action

addaccount <username> <password>

Note: Server should not be running when you are editing the acl file below

Then you open the acl.xml file located in the same folder and add yourself as an object to the Admin group by using the 'user.*' syntax, where * would be your account name.

    <!-- The Admin group can do anything --> 
    <group name="Admin">
        <acl name="Moderator" />
        <acl name="SuperModerator" />
        <acl name="Admin" />
        <acl name="RPC" />
        <object name="user.lil_Toady" />
        <object name="resource.admin" />
    </group>


Now open your mtaserver.conf file and scroll to the bottom, make sure the admin resource is added to the ones that start with the server (note: protected="1" means that it can not be stopped).

    <resource src="admin" startup="1" protected="0">  <!-- This is -->
    <resource src="helpmanager" startup="1" protected="0">
    <resource src="mapcycler" startup="1" protected="0">
    <resource src="mapmanager" startup="1" protected="0">


Now that you're done with server files, you can finally start it. Connect to the server itself and login with your account details: use 'login [username] <password>'. If it tells you to press 'p' you have done everything right, congratulations! If not, do this from the very beginning.