DarkLink Posted January 24, 2008 Share Posted January 24, 2008 First of all, sorry for my bad english Hi, i am new in scripting.. I read the scripting introduction, and try to do it.. So i end it this script: function createVehicleForPlayer(thePlayer, "createvehicle", "468") local x,y,z = getElementPosition(thePlayer) -- get the position of the player x = x + 5 -- add 5 units to the x position local createdVehicle = createVehicle(tonumber(468),x,y,z) -- check if the return value was ''false'' if (createdVehicle == false) then -- if so, output a message to the chatbox, but only to this player. outputChatBox("Failed to create vehicle.",thePlayer) end end addCommandHandler("createvehicle", createVehicleForPlayer) Then i save it, script.lua I do a meta.xml it this: <meta> <info author="DarkLink" description="A few simple commands" /> <script src="script.lua" /> </meta> Then put it together in one folder called "commands" to resourcecache and also zipped to resources! I open the server, and i saw the 101 resources loaded, then i enter in my server... Open the console and write createvehicle, and not happens...i also try the createvehicle 468.. And nothing.. Please...someone more expert try to help me...ok!? I did like to learn more of lua ^^ Thank you! Link to comment
50p Posted January 24, 2008 Share Posted January 24, 2008 101 loaded. Make sure the script is not only loaded, but also running. Link to comment
DarkLink Posted January 24, 2008 Author Share Posted January 24, 2008 101 loaded. Make sure the script is not only loaded, but also running. Thank you!! For the reply!! How i run it? =/ Sorry i am noob.. =/ Thanks! Link to comment
Capsinurass Posted January 24, 2008 Share Posted January 24, 2008 in the server console (Black thing) type start commands OR give yourself admin (it tells you have to do that in the wiki) login then press p go to the resources tab find commands, click on it then press start. Link to comment
DarkLink Posted January 24, 2008 Author Share Posted January 24, 2008 in the server console (Black thing) type start commandsOR give yourself admin (it tells you have to do that in the wiki) login then press p go to the resources tab find commands, click on it then press start. THAAAAANK YOU VERY MUUUUCH!!! REALLY I APRECCIATE YOUR HELP! thank you 2 ^^ Link to comment
allah-cool Posted February 9, 2008 Share Posted February 9, 2008 Is there a way to start the server and some resources AUTOMATICALLY start without having to start every single resource via console or the admin panel e.g starting the FPS calculator is only possible via console and admin panel, it dosent just automatically start when server is started Link to comment
Frank-De-Ruiter Posted February 9, 2008 Share Posted February 9, 2008 Starting resources can be done very simple in the mtaserver.conf: <!-- Specifies resources that are loaded when the server starts and/or which are protected from being stopped. To specify several resources, add more <resource> parameter(s). --> <resource src="admin" startup="1" protected="0"/> <resource src="helpmanager" startup="1" protected="0"/> <resource src="mapcycler" startup="1" protected="0"/> <resource src="mapmanager" startup="1" protected="0"/> <resource src="resourcebrowser" startup="1" protected="1" default="true"/> <resource src="resourcemanager" startup="1" protected="1"/> <resource src="scoreboard" startup="1" protected="0"/> <resource src="spawnmanager" startup="1" protected="0"/> <resource src="votemanager" startup="1" protected="0"/> <resource src="webadmin" startup="1" protected="0"/> As you can see this part of the config tells the server to start all these resources, Now to automaticly start you resource just ad the following line: <resource src="your-resources-here" startup="1" protected="0"/> Just fill in your resource there and save the file, start up the server, go to the server, and see it working without doing anything. Greatings Frank 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