-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
https://wiki.multitheftauto.com/wiki/GetElementMatrix Have a look at the first example. There is a function that will help you out.
-
Maybe he wants this: https://community.multitheftauto.com/index.php?p= ... ls&id=5004
-
1. Your racer1_cl.lua is set as server-side script. 2. You haven't added any handler to "shootgun" event. 3. If racer1_cl.lua will be client-side then there is no gunner defined anywhere. 4. Making it client-side isn't ideal. Not sure if everyone will be able to see it shooting.
-
@TheVenom, I've worked on my drift script ( ) recently and added custom font support for the textlib. Here is the function I modified: function dxText:font(font) if not validFonts[font] and ( type( font ) == "nil" or type( font ) == "string" ) then return self.strFont end self.strFont = font return true end Simply replace the old one with this.
-
@Shape, This is a simple shader. If you visited the server with blurred background then you should already have that shader in your resources folder. Check your downloaded resources and you may find it. Search for .fx file.
-
DO NOT create multiple topics about the same question, please. Thank you. viewtopic.php?f=91&t=44178
-
Yes it is silly mistake. stack overflow can describe a function calling itself infinitely. If you check your function name that is called by the command, it is the same as the MTA function to give player money. Therefore, you override the MTA function with your custom function and then call it every time it's called. The function can't even reach end of its call because it keeps calling itself and I bet you don't even see a message "Here is $1000" because server will never execute it. So simple fix: change the function name to something else and it will work just fine.
-
Make sure you edit the right files. Files in resource-cache are not to be edited. They're extracted files from .zip resources and loaded by server but every time you make a change to these files they are overwritten by the files from .zip resources. When you want to edit resources, edit them from "/resources/" directory. You may also be editing the client files downloaded from the server which is also wrong because once edited, they are downloaded from the server again to make sure they are the same. The files are loaded when resource starts so even if you change the client-side files that you downloaded they are not going to be used.
-
I never advice to create elements outside events. Try to create it in onResourceStart instead.
-
There should be easy way of doing it in the map editor if there isn't such way then it's time to script a "plugin". All you need is posted by karthik_184 above.
-
How do you get to dimension 2 and interior 3? Can you see the ped? You must have some sort of "teleport", don't you?
-
http://www.w3schools.com/xml/xml_validator.asp
-
If you're struggling, there is an example on the wiki how to show all the text from commands anyway. Use wiki please.
-
isElementAttachedToBone is not an MTA function not it exists in your script. If it's an exported function, make sure it's called from correct resource.
-
Well, if you don't know how to script at all, you should start from the basics. Get to know Lua first and then how MTA scripting system works. You'll find everything in the "Scripting" section of the main wiki page: https://wiki.multitheftauto.com/wiki/Main_Page
-
We can't see the video. Make sure you post the link correctly.
-
@DarkLink, Does this answers your question? https://wiki.multitheftauto.com/wiki/GetPedBonePosition
-
The problem is you're trying to add event handler to an element which doesn't exist when the script starts. You first need to create the marker and then add event handler to it. So,: function on_btn_join_clicked(button, state) if (button ~= "left") or (state ~= "up") then return end triggerServerEvent("jf", getLocalPlayer()) local marker2= createMarker (-1208.7, -1073.8, 127.2, "cylinder", 1.5, 248, 211, 6, 153 ) addEventHandler( "onClientMarkerHit", marker2, jstart) showCursor(false) guiSetVisible(fwdw, false) end [.......................] function jstart(element) if getElementType(element) == "player" and (element == localPlayer) then outputChatBox("test") end end
-
The thing is attachElements always attaches an element to another element at specified offset position and rotation. Once you attach it, it will stay at that position all the time like micheal1230 said. This is the correct behaviour of attachElements function. If you want the object to be attached to a bone you need to set elements position to the bone position and rotation on every frame (onClientRender or I'd advice to use onClientPreRender since this event is triggered before all positions are updated so it doesn't look like a lag). You can try to do it yourself if you're not afraid of challenges or you can download a resource which does that. I don't know its name but I'm pretty sure you will find it on community site (just search for "bone"). Or search forum, I'm sure this question has been asked before. Good luck.
-
The only way I can think of is to create a shader to replace them. Then you can use https://wiki.multitheftauto.com/wiki/Eng ... rldTexture and use texture name. Have a look here as well https://wiki.multitheftauto.com/wiki/Shader_examples
-
What's the point having the command server-side? Why not simply make it client-side. Server doesn't need to know about the images being drawn. Unless you need to.
-
I don't understand your question to be honest. If you get wrong coords that's because you use math.abs which will always give you positive values. But still, your question is not clear. "Create sphere between 2 points" doesn't say much.
-
@blazy, Are you sure you want to use this format of the file where each node is named by numbers? There is more hassle when you delete one of them and want to add another one. Unless you're sure you don't want to delete any of the vehicles. First, you need to open the file and then xmlCreateChild to add another node. This function returns the newly created node and then you can use xmlNodeSetValue to set its value of vehicle ID. You'll probably want to extend your system and make it save vehicle colour, upgrades and its health or other information, in that case, you better use node attributes instead of node values or even better, save the data in SQL or MySQL instead.
-
addEventHandler( "onPlayerWasted", root, function( _, killer ) if killer then if getElementType( killer ) == "vehicle" then killer = getVehicleOccupant( killer ); end givePlayerMoney( killer, 500 ); end end )
-
AFAIK, there isn't one. I once had an idea to make one of them and make it easy for other resources to use its features (custom events, exported functions, etc.) unfortunately never pushed myself to even start it..