Jump to content

IIYAMA

Scripting Moderators
  • Content Count

    5,620
  • Joined

  • Last visited

  • Days Won

    128

IIYAMA last won the day on March 1

IIYAMA had the most liked content!

Community Reputation

1,229 MTA Ambassador

About IIYAMA

  • Rank
    Scripting Moderator & User Guide Contributor
  • Birthday 01/01/2016

Details

  • Gang
    [HB]
  • Location
    Netherlands
  • Occupation
    I have never been to the streets of SA... so who knows?
  • Interests
    Design, scripting, UX/UI

Recent Profile Visitors

13,124 profile views
  1. This warning appears when you try to add an event handler, which is already attached to that function. You can either use a variable: local drawingStatus = false if not drawingStatus then addEventHandler("onClientPreRender", getRootElement(), draw) drawingStatus = true end if drawingStatus then removeEventHandler("onClientPreRender", getRootElement(), draw) drawingStatus = false end Or you can use the following utility function isEventHandlerAdded, which you can copy out of the example: https://wiki.multitheftauto
  2. I have added a useful function to the wiki, for positioning dx-effects:

    https://wiki.multitheftauto.com/wiki/GetScreenStartPositionFromBox

    Enjoy! 😛

  3. I have added a useful function to the wiki, for positioning: https://wiki.multitheftauto.com/wiki/GetScreenStartPositionFromBox
  4. The setPedStat was not working, the stat id was not filled in. iprint("purifierHealth", purifierHealth) setTimer (setPedStat, 500, 1, source, 24, purifierHealth)
  5. There was an: if else end And you changed it to an: if if end end While you probably need an : if -- element data else -- element data if -- validation end end Not sure if that fixes everything, it is still a puzzle.
  6. You can also move the oldTx, oldTy, oldTz, px, py, pz validation to here. Or here, line 96 @Bean666
  7. Basic validation: (works in most cases just fine) if isElement(ped) and oldTx and oldTy and oldTz and oldPx and oldPy and oldPz then Advanced validation: (recommended using this when the data comes from user input, export functions or database. But using it for here is also fine.) if isElement(ped) and type(oldTx) == "number" and type(oldTy) == "number" and type(oldTz) == "number" and type(oldPx) == "number" and type(oldPy) == "number" and type(oldPz) == "number" then
  8. For example: local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_enemy_check, 500, 1, source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) To: local player = getElementData(source, "leader") if isElement(player) then local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) end setTimer(f
  9. The owner has complied with providing evidence that this gamemode is unique. @Patrick has validated that. No further accusations will be tolerated without proof. The first topic has been hidden. (This is a copy) @Jacuuuu Please move some of those pictures inside of your topic. And always do that for new [SELL] related topics. That way we can at least moderate if there are people trying to sell stolen resources. Note: if you disagree with our actions you should send us a message, instead of trying to evade our actions. That way this issue would have been resol
  10. You could reduce the amount of zombies. If you want to compare a local machine with a VPS, it is best to bring both of them a little bit closer to each other. That is if you want to know if it is the server that is responsible for the lag, or if it is your internet connection. https://wiki.multitheftauto.com/wiki/Command_fakelag Enable fakelag: <fakelag>1</fakelag> Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch\mtaserver.conf Command: /fakelag <packet loss> <ping> <ping variance> Join
  11. The data rate is indeed an issue. I capped my own ped resource on 300ms. But the quantity also plays a role. It is bad practice to send the same information twice. If the client knows a ped is running, the server does not have to send that information again. If there are no peds around you, the data rate by this resource should be nearly 0. Are you sure that it sends data on the onClientRender rate?
  12. There is only 1 thing you need to know about internal arguments. Those ones that are after the callBack function. If you mix internal arguments with arguments(from serverside), you have to make sure that the last internal argument is not a nil value. Because when all arguments are converted to parameters, both lists will be merged and the first list(internal arguments) will collapse on nil values at the end of the table. Problem: internal2 = nil callServer('isAccountRegistered', username, password, caseVariable, function(internal1, internal2, state) end, "inter
  13. thx! Sorry for my late reply, I didn't notice the notification. The syntax for that function: bool callServer (callFunctionName string [, argument1, argument2, ... ] [, callbackFunction function [, argument1 (internal), argument2 (internal), ...]] ) https://gitlab.com/IIYAMA12/mta-communication-enchantment/tree/master/documentation/syntax#syntax-1 Multiple values can be send over by just adding them between the functionName and the callBackFunction. functionName: 'isAccountRegistered' callBackFunction: function(state) end
  14. You could attach the camera to the ped, see example in this link: https://wiki.multitheftauto.com/wiki/GetCamera The example explains how to attach the camera to a vehicle, without the need of updating the camera with onClient(Pre)Render.
  15. Colshapes are more reliable. You could try these functions: https://wiki.multitheftauto.com/wiki/GetElementColShape < use on marker https://wiki.multitheftauto.com/wiki/GetColShapeSize If there is some abnormality in height --> https://wiki.multitheftauto.com/wiki/CreateColTube (https://forum.mtasa.com/topic/100069-tut-addeventhandler-on-a-group-of-elements-small-tutorial/)
×
×
  • Create New...