BumbiS* Posted July 22, 2010 Share Posted July 22, 2010 Hah, i just start to script MTA, learning from wiki n' stuff, but when i edit a script, save it and start the server that edited script edits back to normal, like i translate ir from english to my language. Server starts, my translated line translates back to normal.. I edited original freeroam resource. Used Lua for windows. Can someone can tell me how to do it right? My english is not too good Link to comment
dzek (varez) Posted July 22, 2010 Share Posted July 22, 2010 probably you are editing client side files, downloaded to client on server connect. You SHOULD edit this (path could be another for you): C:\Program Files\MTA\server\mods\deathmatch\resources\freeroam but you are probably modyfing this: C:\Program Files\MTA\mods\deathmatch\resources\freeroam Link to comment
50p Posted July 22, 2010 Share Posted July 22, 2010 Make sure you edit resources in resources folder, not resource-cache. Also, you can't edit files in your client's folder, always edit resources that are on the server. Link to comment
BumbiS* Posted July 22, 2010 Author Share Posted July 22, 2010 Yes i'am editi in resource-cache... But in resource map there are all are .zip and to edit i need to unzip, edit then zip it again? Link to comment
50p Posted July 22, 2010 Share Posted July 22, 2010 You can unzip them and edit the files inside them. When you extract, make sure you extract it to a folder under the same name as the zip because MTA server first tries to load resource from a folder and ignores the zip with the same name. Link to comment
BumbiS* Posted July 22, 2010 Author Share Posted July 22, 2010 Ok, now it works and i have another question. If the server is online and resource is running, i can edit resource while its running, and save it after edit? or i need to turn off my server or stop resource? Link to comment
50p Posted July 22, 2010 Share Posted July 22, 2010 You can leave server running and save any changes you make. Then you have to "restart " then server reloads the resource with the changes that you made. Link to comment
BumbiS* Posted July 22, 2010 Author Share Posted July 22, 2010 and where can i make commands? In resources or Gamemode? I just created a command in fr_server, restart resource and command didn't worked. Or maybe i need it to make it in fr_client? Command must work, i take it from wiki function showLocalHealth() -- get the player's health and output it local playerHealth = getElementHealth ( getLocalPlayer() ) outputChatBox ( "Your health: " .. playerHealth ) -- get the player's vehicle: if he is in one, output its health as well local playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() ) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) outputChatBox ( "Your vehicle's health: " .. vehicleHealth ) end end addCommandHandler ( "showhealth", showLocalHealth ) Link to comment
MaddDogg Posted July 22, 2010 Share Posted July 22, 2010 Commands can also be in non-gamemode resources, and a resource is not on a same level as a gamemode, so you can't say "resource or gamemode", because a resource can hold a gamemode. The command, you provided, is for a clientside script, so yes, you have to put it into a clientside script file such as fr_client.lua . In the wiki, it always says, whether examples are server- or clientside, if the page itself isn't already limited to server- or clientside scripting. Link to comment
50p Posted July 22, 2010 Share Posted July 22, 2010 Commands can also be in non-gamemode resources, and a resource is not on a same level as a gamemode, so you can't say "resource or gamemode", because a resource can hold a gamemode.The command, you provided, is for a clientside script, so yes, you have to put it into a clientside script file such as fr_client.lua . In the wiki, it always says, whether examples are server- or clientside, if the page itself isn't already limited to server- or clientside scripting. Why don't you explain to him why it's client-side? Saying "yes, you have to put it into a clientside script file such as fr_client.lua" doesn't teach him at all. @BumbiS* Log in as an admin and use "debugscript 3" command to see any errors in your script (server-side and client-side). Check your server console to see if you have any server-side errors (only if you don't use debug window - debugscript command - because it's wasting time to switch between console and game to see the same thing as you see in debug window). You would get an error because getLocalPlayer does not exist on server-side. Link to comment
BumbiS* Posted July 22, 2010 Author Share Posted July 22, 2010 And how can i log in as admin? Link to comment
MaddDogg Posted July 22, 2010 Share Posted July 22, 2010 Why don't you explain to him why it's client-side? Here you go: The first thing to notice that is the getLocalPlayer(). This returns the player element of the machine, who is also running this script. And since there is no player on the serverside, it's a clear indication for a clientside script, where this function is very often used. You can also notice that outputChatBox has no player parameter, which also leads to this conclusion. If you look at the serverside version of this function, you could also there leave out the player element, but that would result in every player seeing the message. Hope, you're satisfied. @Bumbi: You press F8 and then login using "login ". If you did not already create an administrator account, have a look at this: https://wiki.multitheftauto.com/wiki/Ser ... nistrators Link to comment
BumbiS* Posted July 23, 2010 Author Share Posted July 23, 2010 Thanks for helping, and i have a question. How to disable the original chat? I made a another chat with radius and when i type something it shows two lines, the one with radius and the other one without it( Original ) Link to comment
Discord Moderators Zango Posted July 23, 2010 Discord Moderators Share Posted July 23, 2010 Thanks for helping, and i have a question. How to disable the original chat? I made a another chat with radius and when i type something it shows two lines, the one with radius and the other one without it( Original ) showChat Probably use that in conjunction with onPlayerJoin to remove as soon as they join your server. Link to comment
BumbiS* Posted July 23, 2010 Author Share Posted July 23, 2010 No, it doesn't work. That showChat function disables/enables all chat, i can't type anything when ir disabled... And all chat box dissapears, maybe there is some other function to disable it? Link to comment
50p Posted July 23, 2010 Share Posted July 23, 2010 You want to cancelEvent() (cancel the onPlayerChat event) and output your own message. 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