-
Posts
1,449 -
Joined
-
Last visited
-
Days Won
32
Everything posted by DiSaMe
-
setPedAnimation: Just set that argument to false...
-
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.
-
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.
-
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)
-
Thanks for the answer, I think it was helpful. Although I don't feel interested in this now, I may try doing something later.
-
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.
-
O jei tiksliau? Kokių pagrindų? MTA, Lua ar apskritai programavimo?
-
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.
-
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).
-
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.
-
If you don't use the result of the query, it's better to use this function: dbExec
-
Do you use dbFree or dbPoll to release the query result from memory?
-
If you want the weapon to be visible on every client, you have to create it on every client, simple.
-
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
-
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.
-
getElementPosition setElementVelocity
-
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.
-
That's because in the second case you are comparing ACCOUNTNAME to `'denny19'` (what means a column name), not 'denny19'. Remove the backticks.
-
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.
-
Create the same weapon on every client separately.
-
Of course they don't see it, because client-side elements only exist locally.
-
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.