Jump to content

DiSaMe

Helpers
  • Posts

    1,449
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by DiSaMe

  1. Of course you can't cancel the damage that has already been done. You can't prevent the event from having occurred because you can't change the past. This is the case with server-side damage events, they are triggered after the ped/player was damaged.
  2. Or, when the player is still aiming, but in another direction, they will stop aiming at the objet too...
  3. Except "onPlayerTarget" doesn't detect when the player starts/stops aiming, but rather when the player starts/stop aiming at particular element.
  4. DiSaMe

    Vehicle aim

    By 'aiming vector' I mean the vector pointing to direction where the turret is aiming. And I said which matrix exactly, vehicle's matrix.
  5. 'localPlayer' outside functions doesn't come from anywhere. It's nil in that line where 'addEventHandler' is called. And I don't know what tables you're talking about. The problem is exactly not that - 'unpack' takes a table as an argument, but you're passing an element.
  6. DiSaMe

    Table order

    Also, while ipairs starts at key 1 and increases it, pairs loops through the table in unspecified order.
  7. DiSaMe

    Table order

    'ipairs' iterates up to first nil value. Which means no subsequent values are processed in your code.
  8. DiSaMe

    marker's

    isElementWithinMarker
  9. DiSaMe

    Vehicle aim

    If I get it right, returned rotation of turret is relative to vehicle's rotation. So in order to get the target position, you would have to get the aiming vector from turret's rotation, combine it with turret's position using getVehicleComponentPosition and then transform the result into world coordinate system by multiplying it by vehicle's matrix (getElementMatrix).
  10. Oh, come on... local visitCount = 0 function increaseVisitCountOnJoin() visitCount = visitCount+1 end addEventHandler("onPlayerJoin", root, increaseVisitCountOnJoin) Of course, this is server-side, and in order to draw it via DX drawing functions on the client-side, you need to use element data or custom events to send the data to the client.
  11. Maybe this function will help: getPedTask But I don't know if it has some 'aiming' task, you should play around with it and see what it returns to find out. If there isn't such task, then the closest thing you can do is probably checking when aiming control state changes: bindKey But it's not that accurate for detecting when player stops aiming.
  12. So that the effect would be undetectable by visual means but still would exist and eventually cause the element limit to be reached.
  13. What function? MTA doesn't count the players who have visited. You have to do it. Using "onPlayerJoin" event.
  14. I'm not sure how you managed to get a warning related to 'getVehicleOccupant', since I don't see it inside your script. Not at line 52, at least. As for 'unpack', that's obvious: trainData[vehicle] = { ["money"]=trainTable["money"], ["spawn"]=trainTable["spawn"], ["marker"]=trainTable["marker"], ["train"] = vehicle, ["blip"] = finishBlip, ["finishmarker"] = finishMarker } destroyElement (unpack(trainTable["finishmarker"])) destroyElement (unpack(trainTable["blip"])) destroyElement (unpack(trainTable["train"])) trainTable["finishmarker"], trainTable["blip"] and trainTable["train"] are elements and you're passing them to 'unpack'. Also, I don't know what this thing means: addEventHandler("startTrainJob", root, startTrainJob, localPlayer) 'localPlayer' is nil on the server-side (unless you assign anything to this variable yourself, of course) and 'addEventHandler' takes a boolean as 4th argument, but this argument is about propagation, and I don't think it's related to whatever you're trying to do.
  15. DiSaMe

    Table

    Animations, weapon ammo, stats and other stuff are not visible to the client unless they were set since the last time the ped was streamed in. If animation is applied before the ped has time to be streamed in for the client, the animation won't show. In either case, it won't show when the player goes far away and returns back. The simplest workaround is setting a timer which keeps applying the animation every few seconds. By the way... setTimer(setPedAnimation(c_Dancers, "DANCING", "dnce_M_a"), 5000,1) This executes setPedAnimation, which most likely returns true, and then passes true as the first argument to setTimer. Which changes nothing except calling setTimer with invalid arguments, producing a warning message. Instead, you need to pass the called function and its arguments as arguments of setPedAnimation: setTimer(setPedAnimation, 5000,1, c_Dancers, "DANCING", "dnce_M_a")
  16. https://wiki.multitheftauto.com/wiki/OnPlayerJoin https://wiki.multitheftauto.com/wiki/OnPlayerQuit
  17. DiSaMe

    Money help

    takePlayerMoney needs player as the first argument. And = is assignment operator. Use == to check if values are equal to each other (though there's no need to check for equality in this case).
  18. But it's more efficient to use the team as table key like Necktrox did rather than loop through the table and check the player's team against every value.
  19. So that servers could DDoS other servers? Doesn't sound good. Unless a client-side setting or confirmation window was made, but that still would be less convenient for players.
  20. Yeah, I did make a generator, but a couple of videos is the only thing I've produced (in case someone assumes wrong, it's not the same script in the image under that link). I tried making my own streamer to avoid reaching the element limit, but object creation/destruction were very slow back then. Also, trees were streamed out at short distance, but this problem would become less relevant with some improvements. Well, then I guess I'll stick with PayPal for now before I see what's what.
  21. Then rotate it from within "onClientPreRender".
  22. Thanks, and yeah, it's just that the range cannot be strictly defined, but... Maybe I'll try something
×
×
  • Create New...