Jump to content

DiSaMe

Helpers
  • Posts

    1,449
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by DiSaMe

  1. setPedAnimation: Just set that argument to false...
  2. getElementData returns whatever was set, not necessarily a string. If it returns a boolean, it means either a boolean was set or there was no value set at all.
  3. As addCommandHandler page in wiki says, handler function has player and command name as the first parameters: player playerSource, string commandName, [string arg1, string arg2, ...] So the first line should look like this: function pay(player, command, amount) In addition, since player may enter the command without writing the amount, you should check if tonumber(amount) returns a number value. Otherwise warning messages will show up.
  4. In setTimer, the first argument is the function you want to be called, then goes the time and execution count and further is whatever you want to pass to the called function. So if you want destroyElement(smoke) to be delayed, you have to call setTimer like this: setTimer(destroyElement, 2500, 1, smoke)
  5. Thanks for the answer, I think it was helpful. Although I don't feel interested in this now, I may try doing something later.
  6. Nu taip, nelabai daug čia mūsų Gal pavyktų daugiau žmonių į MTA pritraukti, jei normalų ped'ų valdymo script'ą padaryčiau. NPC HLC toks nenusisekęs išėjo, tai dabar geresnį po truputį darau.
  7. O jei tiksliau? Kokių pagrindų? MTA, Lua ar apskritai programavimo?
  8. First, event "onPlayerChat" only has 2 arguments, the message and its type. Second, your function theFormat does nothing. And third, using "id" as the name of the function is confusing, especially when there's a variable with the same name. This could lead to the situations in which you try to use a value without noticing that it's being overriden by another value.
  9. I have a question about Doppler effect. Should the objects appear red when you slowly move towards them? I thought they should be red when you move away from them. When you approach them, the wavelength decreases (blue shift), and when you move away, it increases (red shift).
  10. DiSaMe

    AI

    There is no problem with usage of require function in the library, because removing it and including the files into meta.xml will have the same effect (unless I have missed something). Since the library is grid-based and for 2D games, its usage in MTA would limit the pathfinding to 2D plane. As for single player AI, it's not worth bringing it to MTA. It would require some effort to make it synced, and it relies on client-side data too much. Remaking it in scripts is better. Actually, NPC HLC was my attempt to do something like that, but since I was focused on the traffic script, the basic tasks were priority and NPC HLC didn't come out really good. I won't update it, but I may make another ped-controlling script from scratch. The problem which often makes scripting harder is making the script control all peds at the same time. But I recently realized that Lua coroutines are a good way to avoid this because they allow scripting of a single ped in continuous code without having to care about other peds.
  11. If you don't use the result of the query, it's better to use this function: dbExec
  12. Do you use dbFree or dbPoll to release the query result from memory?
  13. If you want the weapon to be visible on every client, you have to create it on every client, simple.
  14. What's so hard to understand? When you create a weapon, do this on every client, not just the one who entered the vehicle. That means, sync them manually. When the key is pressed, this information has to be synced too. The general ways to transfer the information between the server and client are element data and events: setElementData getElementData addEvent addEventHandler triggerClientEvent triggerServerEvent
  15. Slothbot resource probably needs to be modified to be able to cooperate with other ped-controlling resources. Since NPC HLC is applied to already existing peds and it can be both enabled and disabled (therefore allowing to pass the control to other scripts), it does what is needed from its own side for cooperation, but with Slothbot, it's different. If there's a way to make a Slothbot do nothing (so that Slothbot and NPC HLC resources wouldn't try to control it at the same time), then it may be possible.
  16. DiSaMe

    Solved

    As I said, the event does not exist right after the player has joined because the script has not started yet. Only when onClientResourceStart event is called, you can be sure that the script is running.
  17. That's because in the second case you are comparing ACCOUNTNAME to `'denny19'` (what means a column name), not 'denny19'. Remove the backticks.
  18. It doesn't work because backticks cause everything between them to be interpreted as the column name. As a result, ACCOUNTNAME column is not checked against a value passed to the dbQuery function, but instead, it's checked against a value in the column whose name was passed to dbQuery.
  19. Create the same weapon on every client separately.
  20. DiSaMe

    Question

    Yes, you can. In such case, triggerEvent will return false.
  21. Of course they don't see it, because client-side elements only exist locally.
  22. CJ clothes do not have any IDs, SA-MP does not have any clothing functions and because of that, there's no way for you to have seen non-default CJ clothes in SA-MP. So whatever you need for clothing, import a custom model (like SA-MP did), create an object and attach it to the bone. Simple.
×
×
  • Create New...