Jump to content

AMARANT

Members
  • Posts

    748
  • Joined

  • Last visited

Everything posted by AMARANT

  1. Yeah probably I'll report it right now But what do you recommend me to make it spawn on quit event?
  2. Why setVehicleIdleRespawnDelay function doesn't work on player death or quit event? Check this simple code below: theVehicle = createVehicle(547,100,300,15,0,0,90) setVehicleRespawnPosition(theVehicle,100,300,15,0,0,90) function RespawnVehicle() toggleVehicleRespawn(theVehicle,true) setVehicleIdleRespawnDelay(theVehicle,10000) end addEventHandler("onPlayerWasted",getRootElement(),RespawnVehicle) addEventHandler("onPlayerQuit",getRootElement(),RespawnVehicle) Note: On the exit vehicle event works just fine.
  3. Is it possible to change parent element of some GUI-element dinamically in-game? I tried https://wiki.multitheftauto.com/wiki/SetElementParent but it didn't work.
  4. AMARANT

    License mod

    Here people don't make scripts for someone. Here people help to make them.
  5. https://wiki.multitheftauto.com/wiki/GuiSetAlpha ?
  6. 'Area' in '[]' is a key. Marker will be a value. All of them will be a table. You can set anything in '[]' brackets but if you want to create several markers then you obviously need numbers because it's easier to get them in the future. Anyway you can set anything you want as a key.
  7. Here's an example: myMarker={} for i=1,10 do myMarker[i]=createMarker(1000+i,2000+i,15,"cylinder",2,255,0,0,125) end
  8. Of course it's possible. Just use lua tables.
  9. I don't understand why you need this... When you set some variable you have to name it yourself and it can't be named automatically from some string or something.
  10. And what's the problem? You can't name a marker but you can set its element data. Pass required arguments and do it.
  11. You can pass in custom functions any arguments you want.
  12. function onBrokenLeg ( attacker, weapon, bodypart ) if weapon then if bodypart == 7 and not getElementData(source,"brokenleft") then setElementData(source, "brokenleft", true) outputChatBox("You broke your left leg") end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), onBrokenLeg ) ?
  13. function onBrokenLeg ( attacker, weapon, bodypart ) if weapon then if not getElementData(source, "shot1") then setElementData(source, "shot1", true) return end end if getElementData(source, "shot1") then setElementData(source, "shot1", false) end if bodypart == 7 then outputChatBox("You broke your left leg") end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), onBrokenLeg ) This code works if you get shot twice. Element data 'shot1' must be set to 'false' when your resource starts.
  14. So your the only one condition of getting your leg broken is to be hit in a left leg. Have you checked what element data returns with debug message? It seems that it returns 'true' and script performs its actions including your message with broken leg.
  15. Then how do I now what is your 'place' value?
  16. Put a debug message at the top of the code and see what your element data returns. EDIT*: BTW is this your full code? You gave a piece of it and it's hard to help you.
  17. Maybe it's because of setting element data to 'true'. Eventually your player's element data gets 'true' value and it's saved even if you restart resource. So the right way is to set it to 'false' after resource starts and then test your code.
  18. Надеюсь что да, ведь я уже джва года хочу такой сервер.
  19. Glad to hear that the new version of MTA is out! Keep up good work guys!
  20. Because client-side version of handler function doesn't need player source argument but server-side does.
  21. Actually yes... My bad. I forgot that it's a new function for MTA.
  22. It's only gonna work client-side. To do it server-side use playerSource argument instead of commanName. That will be your player for attaching weapon.
  23. Because in your code there's no any 'source'.
  24. AMARANT

    SetMoney

    Open your script files and press Ctrl+F then find what you want.
×
×
  • Create New...