ADM_supervoltage Posted February 4, 2009 Share Posted February 4, 2009 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
arc_ Posted February 4, 2009 Share Posted February 4, 2009 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
ADM_supervoltage Posted February 4, 2009 Author Share Posted February 4, 2009 doh i mean that u can tweak it by giving u something out a resource.. like adding exp points into your account data..... Link to comment
arc_ Posted February 4, 2009 Share Posted February 4, 2009 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
ADM_supervoltage Posted February 4, 2009 Author Share Posted February 4, 2009 *ahem* i do not own a server.... i only want to tweak a bit the exp to give myself lots of'em... so i cant edit the accounts.xml... Link to comment
arc_ Posted February 4, 2009 Share Posted February 4, 2009 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
ADM_supervoltage Posted February 4, 2009 Author Share Posted February 4, 2009 forgot to say that i'm admin on that server... isn't any chance then? Link to comment
arc_ Posted February 4, 2009 Share Posted February 4, 2009 You will have to ask the server owner to increase your exp for you. Link to comment
ADM_supervoltage Posted February 4, 2009 Author Share Posted February 4, 2009 .......................................... the owner wants this too... he wants to make it like u can edit the ACL.XML from admin panel.. Link to comment
arc_ Posted February 4, 2009 Share Posted February 4, 2009 ..........................................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
ADM_supervoltage Posted February 4, 2009 Author Share Posted February 4, 2009 You can already give people admin rights from the admin panel, if that's what you mean. no no no....... i mean u can edit the acl.xml from admin panel without stopping the server... in rest it's good Thank you for the help! 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