Jump to content

IIYAMA

Moderators
  • Posts

    6,061
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. Re-writting it in your own style is a good way of learning how the code works.
  2. https://wiki.multitheftauto.com/wiki/GetVehicleHandling or https://wiki.multitheftauto.com/wiki/GetModelHandling or https://wiki.multitheftauto.com/wiki/GetOriginalHandling At key/index. maxVelocity Combine with the post of the @Unknown-guy.
  3. siren-system Not enough context to help you with this. For the interior. Use createElement and set it's children. local newElement = createElement("interiorEntrance", "interiorEntrance:" .. interiorID) for i=1, 30 do local marker = createMarker (...) setElementParent(marker, newElement) end destroyElement(newElement) -- will also destroy it's children. Syntax createElement: element createElement ( string elementType, [ string elementID = nil ] )
  4. Put this in your meta.xml <oop>true</oop> As I said before, do not mix oop in your script, unless you know what you are doing.
  5. https://wiki.multitheftauto.com/wiki/RemovePedFromVehicle
  6. function dxOutputMessage(message, player, r, g, b) -- this works for server side trigger from another resource triggerClientEvent(player, "dxMessage.dxOutputMessage", player, message, r, g, b); end function outputMessage(message, player, r, g, b) dxOutputMessage(message, player, r, g, b); end addEvent("dxMessage.outputMessage", true); addEventHandler("dxMessage.outputMessage", root, function(message, r, g, b) outputMessage(message, client, r, g, b); -- and here end); It is not recommended to mix oop syntax in your code, unless you want to learn that,
  7. Please follow the createVehicle syntax vehicle createVehicle ( int model, float x, float y, float z [, float rx, float ry, float rz, string numberplate, bool bDirection, int variant1, int variant2 ] ) https://wiki.multitheftauto.com/wiki/CreateVehicle You have to fill in the model and it's position (x, y, z). So for example: createVehicle(400, 0, 0, 10) This will create a vehicle with the skin/model 400 in the middle of the map. And if that doesn't work, please check if that part of the code gets executed.
  8. local sound function say1() if isElement(sound) then stopSound (sound) end local x, y, z = getElementPosition(localPlayer) sound = playSound3D('say1.mp3',x,y,z) setSoundMaxDistance(sound, 25) end addCommandHandler('say1', say1) ----------------------------------------------------- addEventHandler("onClientRender", root, function () if isElement(sound) then local x,y,z = getElementPosition(localPlayer) setElementPosition (sound, x, y, z) end end) There is no source available in those functions. Not here: https://wiki.multitheftauto.com/wiki/AddCommandHandler And not here: https://wiki.multitheftauto.com/wiki/OnClientRender
  9. It has to do with weather or/and time. As you can see, it is getting dark there. There are no functions for that.
  10. Insert it in `List` like this. The variable `player` is used as key, which leads to the data(another table). Saving List[player] = {Value, Value2, Value3} Loading local data = List[player] local value1 = data[1] local value2 = data[2] local value3 = data[3] Looping for player, data in pairs(List) do local value1 = data[1] local value2 = data[2] local value3 = data[3] end Please do not abuse using the predefined variable `source` inside of an addCommandHandler. Just simple: function ShowRank (player) Since you already know that it is a player (or false if it is activated by script.)
  11. I wouldn't hate you for that, I am a human after all. But I do hope you are a human too and let one of our efforts not vain.
  12. yes, but if you do that, you must make sure that the receiver resource is always running while using the other resource.
  13. And I shouldn't forget to tell you that the resource must be running as well.
  14. nope, in at least one RESOURCE where you want to use it. It can be in any server file, but it doesn't have to be added multiple times, just one time.
  15. Time to get started @santinet12, thanking us will even so put our effort in vain.
  16. A triggerServerEvent is used to communicate with the server. It is required that the event is added serverside before used. addEvent("onPlayer(ResourceName)Start", true) The addEvent function will make sure that the event is added. (serverside in your case) The first argument is the event name "onPlayer(ResourceName)Start". The second argument will enable events from a different side (client/server). If set to false you can't use triggerServerEvent/triggerClientEvent, only triggerEvent to activate it. For more information: https://wiki.multitheftauto.com/wiki/AddEvent
  17. So you are saying that verification is a useless thing? Receiving very different code from 3* people and answer it with 'doesn't work' is 10x worse. They all might work if applied correctly. * Almost 4.
  18. Where is your next attempt bro? We didn't even see what you did with our code. It is almost as if you are not working either.
  19. Yea should break the loop if there are no rows. if row then -- your thing else break end
  20. If you don't debug your code manually, then you don't work either. Sounds like a great match to me.
  21. Please read those two lines better. Because at the end it is not focused.
  22. It looks like you are trying to use the predefined variable `client` within a function that is not called by an addEventHandler. Also you can't fill in PepsiCan as second argument, only an elementType in the form of a string is acceptable. So use the type "object", because that is what PepsiCan is.
  23. There is no event for that. What you need to do is either find the player where the dimension/interior changes. Or use a timer to detect if it has changed. The attached elements can be retrieved like this: (if setElementParent is used) local attachedObjects = getElementChildren ( player, "object") -- this one might work as well, not tested. local attachedObjects = getElementsByType ("object", player )
  24. You could try: setElementParent(object, player) Not sure if it works, because I haven't tested it with dimension change before.
×
×
  • Create New...