Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. 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.
  2. Time to get started @santinet12, thanking us will even so put our effort in vain.
  3. 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
  4. 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.
  5. 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.
  6. Yea should break the loop if there are no rows. if row then -- your thing else break end
  7. If you don't debug your code manually, then you don't work either. Sounds like a great match to me.
  8. Please read those two lines better. Because at the end it is not focused.
  9. 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.
  10. 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 )
  11. You could try: setElementParent(object, player) Not sure if it works, because I haven't tested it with dimension change before.
  12. IIYAMA

    Vehicle shot

    https://wiki.multitheftauto.com/wiki/OnClientPlayerWeaponFire with https://wiki.multitheftauto.com/wiki/ProcessLineOfSight would do the job.
  13. function bindKeysForPlayer (player) bindKey (player, "f2", fixcar) -- put here the bind keys end addEventHandler("onPlayerJoin", root, function () bindKeysForPlayer (source) end) addEventHandler("onResourceStart", resourceRoot, function () local players = getElementsByType("player") for i=1, #players do bindKeysForPlayer (players[i]) end end) Here you have an example to fix your car with f2. You can expand it as far as you want.
  14. IIYAMA

    Help me

    You can't find them, because you have to make them. setElementData Would help you doing that.
  15. IIYAMA

    Help SetTimer

    function bossEffect1 (ID) ---Off Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",false) removeElementData(bossDeady[ID][12],"boss.name") removeElementData(bossDeady[ID][12],"health") setElementAlpha(bossDeady[ID][12],4) setPedOnFire(bossDeady[ID][12], true) setTimer (bossEffect2, 4000, 1, ID) end end function bossEffect2 (ID) --- On Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",true) setElementAlpha(bossDeady[ID][12],255) setElementData(bossDeady[ID][12],"boss.name",name) setElementData(bossDeady[ID][12],"health",health) setPedOnFire(bossDeady[ID][12], false) end end function executeBoss (ID) setTimer (bossEffect1, 5000, 1, ID) end executeBoss (ID) -- start the boss setTimer(executeBoss, 60000, 0, ID) -- start the boss over 60 seconds and infinity times = 0. Please mind the performance man, too much timers can cause a lot of lagg if not used correctly.
  16. Ah, interesting insight.
  17. It can not change them, but it can fake them: triggerEvent triggerServerEvent https://wiki.multitheftauto.com/wiki/TriggerEvent https://wiki.multitheftauto.com/wiki/TriggerServerEvent
  18. That doesn't sounds right, unless there is another script interfering.
  19. Please start active debugging your code if viewing errors/warnings isn't enough.
  20. This code is far from ready for multiplayer. Lots of bugs. One of your main problems is the addCommandHandler function, please do some research about it. It will bug your whole system if you do not understand correctly how it works. https://wiki.multitheftauto.com/wiki/AddCommandHandler Is this what you mean with gate? (it is recommended to write English code for situations like this) local reja1 = createObject(971, 2440.8, 2448, 72, 0, 0, 42) local reja2 = createObject(971, 2394.5, 2493.8999, 72, 0, 0, 42) setTimer(quitarrejas, 4000, 1, reja1, reja2) function quitarrejas(reja1, reja2) if isElement(reja1) then destroyElement(reja1) end if isElement(reja2) then destroyElement(reja2) end end
  21. Make sure the server is OFF if you edit it manually.
  22. It looks like it can't find the maps. Please read the description: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13118
  23. It really depends who you hire. If I did paid scripting(which I do not), I would charge you around 10 euro per hour. The length of the project depends on your criteria. But there are people who do it for 3 euro per hour... or 5 cent per code line.
  24. if getElementData(player, "content-downloaded") then -- spawn in freeroam end if not getElementData(player, "content-downloaded") then -- spawn in katana land end -- finish downloading setElementData(player, "content-downloaded", true, false)
  25. Create less markers I think. If you have a texture file, make it a power of two and optimise it with dxt1or dxt5.(which will reduce the texture ram usage with dxt5 = 75% / dxt1 = 87,5%)
×
×
  • Create New...