Jump to content

how to create a command for a resource?


Recommended Posts

as the title says how can i create a command for a resource?

u know like executing a command in the admin panel to get something from a resource....

i think u understand........

if u dont then here is an example:

the scorboard: u tweak it to give you 2 times kill if u kill one (like u kill one and it gives u info that u killed 2 of him)

Link to comment

It's not very clear to me what you want.

If you need to register a console command that players can use (so they can type things like /setskin, /buyhouse in the chatbox), look at the addCommandHandler scripting function.

And the scoreboard simply displays data that is specified by gamemodes. This could be number of kills, number of stolen cars, anything really - the number is determined by the gamemode, the scoreboard simply displays it. If you want a particular gamemode to give you two points for each kill, you will need to edit the code of that gamemode.

Link to comment

Well, sure.

The score that is displayed on the scoreboard is stored in the player's element data, which you can change with the setElementData function from any resource. You just need to know the name of the element data under which the score is stored. You can find this name out by looking at the gamemode's source code, or alternatively you can start the gamemode and output all the element data of a player, then look for the one that contains the score. Use the getAllElementData function for this.

Similarly, account data can be set with setAccountData from any resource. Again, you need to find out the name of the score account data. Your best bet for finding this name is looking at accounts.xml, where the account data is stored.

Link to comment

No, you're out of luck in that case ;). The accounts.xml is obviously stored on the server, and as a player you cannot access it.

Please refrain from asking for cheating instructions on the official MTA forums in the future.

Link to comment
..........................................

the owner wants this too...

How was I supposed to know that?

Anyway, have him look at the server's account.xml, see if the experience is stored in there. If it is, it's just a matter of running the setAccountData function (there's a tab in the admin panel where you can type Lua code to execute). You can look at the MTA wiki to find out how this function works.

If it is not in accounts.xml, it will be in a gamemode-specific file or in a database. In that case you will have to find out what to do by yourself I'm afraid.

he wants to make it like u can edit the ACL.XML from admin panel..

You can already give people admin rights from the admin panel, if that's what you mean.

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...