Jump to content

kieran

Members
  • Posts

    367
  • Joined

  • Last visited

Everything posted by kieran

  1. function zombset (player) x,y,z = getElementPosition(player) -- to get player position myrot = getElementRotation(player) -- to get the player roatition zomb = createPed(1, x,y,z) setElementPosition(zomb, x+4,y+3,z) -- to set the zombie position near the player setElementRotation (zomb,-myrot) -- to make the ped look at the player --now to make the ped go towards the player you can use control state setPedControlState(zomb,"forwards", true) end addCommandHandler ("createPed", zombset) I don't think this is right...
  2. I still don't really get it, am I meant to make the function and then create the ped? All I need is it to spawn a ped close to player I can work from there. (Sorry, I am noob scripter)
  3. Thanks again bud :3 will mess with it and tell you result.... Might be a few days though... haha
  4. Hello, I am pretty new to scripting on MTA, I done some visual C in college and was wondering if anyone could direct me to a website/topic about spawning zombies client side, I have looked at other peoples scripting, but as I say, I'm inexperienced, so if there is even a script with comments saying the purpose of the functions etc... could you post the link? Thanks for reading!
  5. If you don't want to over complicate it I messed around with something and it worked, I am fresh at scripting, but I am learning slowly here's the extremely basic one I made (It is NOT group specific, it opens for ALL players unless you add it to open for just groups,) object = createObject(980, x, y, z, rx, ry, rz) --!<rx,ry,rz are the rotations of the element, x,y,z is the position> marker = createMarker(x, y, z, "cylinder", 7, 100, 0, 0, 0) --!<"cylinder", "carona" etc are types of markers, next is size, R,G,B and alpha> function gateopen(player) --!<This is where we will write the function to move the gate> moveObject(object, speed, x,y,z) --!<object is the first line, then time (in ms) and xyz> end --!<You MUST end the function> addEventHandler("onMarkerHit",marker,gateopen) --!<If a player hits the marker, the function will be triggered, ("Command", marker, function)> function gateclose(player) --!<Function to close the gate> moveObject(object, speed, x,y,z) --!<It will move on rotations too!> end addEventHandler("onMarkerLeave",marker,gateclose) --!<This will close the gate when the player leaves the marker> Hope it helps! here is the original YouTube video! (he put object where marker should be on handler, so it didn't work for him)
  6. kieran

    Bad lua script

    @Gourmet. was right, I was trying to make a gate move when I was hitting a marker... code is below, improve it, use it, do as you wish, is as basic as it gets, but proud of my first script (That I kinda stole from YouTube) object = createObject(980, 2337.3999023438, 1573, 12.60000038147, 0, 0, 90) marker = createMarker(2339.3999023438, 1573, 9, "cylinder", 7, 100, 0, 0, 100) function gateopen(player) moveObject(object, 3000, 2337.3999023438, 1583.400390625, 12.60000038147) end addEventHandler("onMarkerHit",marker,gateopen) function gateclose(player) moveObject(object, 3000, 2337.3999023438, 1573, 12.60000038147) end addEventHandler("onMarkerLeave",marker,gateclose) Note that the gate is inside of an MTA building, so you will need to fiddle with cords before it works!
  7. kieran

    Bad lua script

    Code does not work, it should, but it's not.... Thanks for help, I'll keep looking on forums and cross my fingers bro. That or download a resource.....
  8. kieran

    Bad lua script

    I have only started scripting 2 days ago and know almost nothing about MTA's lua format... I know a little about C++ as I had a month of C# as part of a course but nothing really helpful such as what should be client or serverside. (script is of course server side) but my question was, do I need to make another script client side so that the server can pull the information from it?
  9. kieran

    Bad lua script

    Thanks for the replies! I tried it but they don't work..... Do I need to make groups? I was just trying to use default Admin group from ACL.xml, but failed...
  10. Hello, I am trying to edit a script I found from a YouTube tutorial, it almost works, except it doesn't like the EventHandlers I have in it..... Here's the code. Server Error Message [2017-06-07 17:08:08] Resources: 203 loaded, 0 failed [2017-06-07 17:08:08] Starting resources... [2017-06-07 17:08:36] Server minclientversion is now 1.5.4-9.11324.0 [2017-06-07 17:08:55] WARNING: 1892\gate.lua:13: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [2017-06-07 17:08:55] WARNING: 1892\gate.lua:19: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [2017-06-07 17:08:55] Gamemode 'Under Maintenance' started. Lua Code object = createObject(980, 2539.5, 1343.2998046875, 12.60000038147) marker = createMarker(2539.5, 1343.2998046875, 12.60000038147, "cylinder", 2, 100, 0, 0, 100) function gateopen(player) local data = getElementData(Player,"job") if (data=="Admin") then moveObject(object, 500, 980, 2539.5, 1343.2998046875, 15.60000038147) else outputChatBox("Message") end end addEventHandler("onMarkerHit",gateopen) function gateclose(player) moveObject(object, 2539.5, 1343.2998046875, 12.60000038147) end addEventHandler("onMarkerLeave",gateclose) Any help at all is appreciated, I know what's wrong, I just have no idea how to fix it (I am learning slowly, only been 2 days since I started)
  11. Thanks so much buddy! Turns out I was editing the wrong map...
  12. Hey man, thanks for the fast reply! :D but can you explain this a bit more? Do I need to just copy the .map over and add it to the .xml to fetch it or copy and paste the .map under the already loaded one? if the last one, should I use new <map> tags or keep it inside one <map> tag? Oh! and another sort of unrelated mapping question.... I am using the item "gnhtelgrnd_lvs" to build bases with as it is a good big concrete texture and takes up small space.... But it doesn't load from a far distance and I have placed it where I deleted a building on default map, how would I get it to load faster so it wasn't a giant hole from far away? Thanks again mate
  13. Hello MTA community (And SAMP) I recently started a server and I am currently learning LUA through YouTube videos and editing resources! but I have stumbled into a problem... I have created 2 bases, both rather large, the problem is they are 2 different .map files, is there a way I may merge them? I have tried simply copying it over and changing item IDs so no conflicts were there... But no luck! please help! thanks
  14. kieran

    Reducing Lag

    Didn't know where to post this, but here is how I boosted my FPS by at least 20 on a Toshiba satellite and made it run good even for college, best part is, it's easy and there's no downloads required! Steps are as follow: A guide on disabling svchost processes/services: http://www.instructables.com/id/Fix-Svchostexe-Using-High-Memory-on-Windows-7/ This next part is slightly important for people that have glass task bar, it tells you how to get visuals running for best performance. 1. Open control panel. 2. Click "Advanced system settings". 3. Click "Settings" under the section "Performance". 4. Click "Adjust for best performance". 5. Restart PC 6. Ensure there's no processes using +7 CPU in task manager then load MTA. Happy gaming! Still got lag? Try the following! 1. Open task manager. 2. Go to services tab. 3. Click "services...". 4. Make sure you have "Extended" enabled on the bottom left, it is important for next steps. 5. This may take some time, but sort services by "Status" so "Started" shows at top. 6. Now you need to sift through started processes, disable any that you don't need and are just wasting CPU. 7. Use right mouse button to click the process, then either edit its properties or click disable 8. ENSURE YOU READ THE PROCESS DESCRIPTION CAREFULLY, IF UNSURE PLEASE RESEARCH ITS USE ON ANY BROWSER YOU HAVE. DISABLING IMPORTANT PROCESSES MAY LEAD TO MACHINE FAILURE!!! 9. FINAL STEP! Restart your PC and hopefully your gameplay will be improved!
  15. I have a little tip, I use a Toshiba Satellite and it was murder with FPS, instead of installing modified operating systems, check CPU, on windows 7 it is a common problem for low end laptops to have up to 100% CPU usage from "svchost" or "Trusted Installer" you can however stop these, click the services using a lot of memory in task manager (services tab), go to "services...", click exteneded tab and READ DESCRIPTION CAREFULLY. If it sounds like it won't effect your computer and isn't vital (so just looks for updates) then right click it and click disable, you also want to disable aero glass bar, windows is made to check every window at all times making sure they have the bar, so disabling it should (in theory) boost gameplay by a small fraction. And if you're really struggling with FPS you can probably buy parts that are compatible from your manufacturer online, so bigger RAM, better CPU etc.... further more you play on a laptop, you will have lags no doubt, so ensure your laptop gets a good vacum at the fan or if you are taking the case off use compressed air to remove dust, this should keep your laptop cool and reduce lags. P.S. Sorry for taking this off topic, but lag is something I feel strongly about, I have learned to play with it and don't think others should suffer, also congrats on fixing it!!!
  16. Good News! I have fixed it! Try right click on the shortcut and then go to properties, then go to compatibility, finally run this program in compatibility mode for windows XP (Service Pack 3) ... if that does not work then go to reg edit (quick way is open task manager> Click "services..." or right click computer in the start menu and then manage) and ensure the following services are started. Application Information Applicaton Layer Gateway Service TCP/IP NetBIOS Helper If this doesn't work then uninstall MTA, making sure you do full uninstall and install it again, if all else fails you may need to go back to the store you bought your PC from and explain the issue. Hope this helps. NOTE: THIS IS FOR WINDOWS 7 ULTIMATE (32 BIT) OTHER VERSIONS OF WINDOWS WILL VARY WITH COMPATIBILITY MODE etc.
  17. I have the same problem, connection time out on any server, disabled a few services on reg edit yesterday and rebooted, can't connect and forget what services I disabled (I know it was svchost services but can't recall which ones) So what I'm asking is could it possibly be a process/service disabled in reg edit? And also what processes are required for running MTA?
×
×
  • Create New...