-
Posts
1,449 -
Joined
-
Last visited
-
Days Won
32
Everything posted by DiSaMe
-
You can try making multiple narrow radar areas of different lengths and they will look like a circular radar area when put near each other.
-
How would what be done? If you want the client-side files to be impossible to steal, don't use them. You can't expect to make the MTA client use the data without downloading it first.
-
Yes. The only way to make sure that no one can get the script is not sending it to the players.
-
I don't agree. Learning a programming language is a matter of hours (or even minutes if you only count the basics). Learning to program is a different thing and it takes from hours or days (for a basic understanding) to years (for good skills).
-
http://www.lua.org/manual/5.2/manual.html#3.4.10
-
Correct me if I'm wrong, but there's no data type "storage" in SQL. As for table, of course can't simply concatenate it into the string. This is not a good way to organize your database structure, anyway. But if you still want to make it like that, you can convert the table to a string and vice-versa using these functions: toJSON fromJSON And the last thing to say, do not concatenate the values directly into the query string. Pass them as separate arguments into dbExec to avoid code injection.
-
Don't use element data for this. Trigger the event instead to avoid the exponential growth of bandwidth usage as player count increases.
-
Why not to run MySQL in your computer (assuming that's where you run MTA server)?
-
Remote trigger means triggering from server to client and vice-versa. Triggering onClientResourceStart doesn't require that. But since that may cause some mess, you may want to try making a wrapper function for addEventHandler which defines specific behavior for onClientResourceStart event, such as storing the handler functions into the table and executing them at the end of the script.
-
It doesn't work on slothbots and NPC HLC peds because it doesn't work at all. targetElem is either undefined or a string.
-
Variable 'source' is not defined in functions 'martinVehicle' and 'adamVehicle'.
-
Event "onPlayerQuit" doesn't have any vehicle parameters.
-
Lua and Squirrel are quite similar. Like Squirrel, Lua is dynamically typed, and even local variables are defined in the same way (keyword 'local'). Also, I'm not sure, but tables look exactly the same to me. Block syntax is different (Squirrel uses C-like syntax, so it has { and }, while Lua uses words, such as 'then' and 'end'). In addition, Lua doesn't have classes, though you can use metatables to make tables work like classes. So if you know Squirrel, Lua should be easy to learn. As for Pawn, it's harder than Lua since you have to care about data types and some other low-level stuff.
-
You can save the files using file functions and load the scripts using loadstring fileCreate fileOpen fileWrite fileRead loadstring
-
Send the map data to players and create the objects on the client side triggerClientEvent --or triggerLatentClientEvent
-
data/maps/oceandrv/oceandrv.ide has objects with these model IDs defined: 3096, od_walkway2, od_lighthouse, 1, 200, 0 3097, od_walkway3, od_lighthouse, 1, 125, 0 3100, od_lightext, od_lighthouse, 1, 150, 132 3248, od_lightint, od_lighthousein, 1, 66, 128 The second column is the name of DFF and COL. DFF should be in models/gta3.img and COL is probably a part of data/maps/oceandrv/oceandrv.col archive. Took 5 minutes to find
-
The scale is changed for every client aware of the object being scaled. If it's scaled on the server, then it's scaled for all clients, and that's how most functions available on both server and client work. What you wrote makes it feel like the function doesn't work for anyone except D&G
-
If server and client scripts were completely separate, the latter ones would be nearly useless. But since client-side scripts can use all elements the client sees and server-side elements are visible for client, you can use functions on server-side elements in client-side scripts. The general ways to transfer the data between server and client are custom events and element data: addEvent addEventHandler triggerServerEvent triggerClientEvent setElementData getElementData When you cross-trigger the event on one side, the handler functions for that event on the other side will be called. You can pass the data as additional arguments and it will be transfered to another side. Element data is a simpler way to synchronize data: whatever you set on server/client becomes automatically synced for server and all clients unless you set the synchronize argument to false. Also, you can set the synced identifier and use it to get the element on the client: setElementID getElementByID
-
It shouldn't be hard to remake the gravity yourself. getElementVelocity setElementVelocity
-
Since static objects don't collide with each other, that requires a script which detects the collisions and applies the force itself. You can do this using these functions: isLineOfSightClear processLineOfSight setElementVelocity setVehicleTurnVelocity But that requires some experience related to calculations in 3D.
-
Is collision really disabled? When you walk into the object, do you go through it? If so, then yes, the collision is disabled. But if the object only goes through other objects, that's not a 'bug'. It's just the way the attachments work. First, the attached element is fixed to the attachment offset. And second, the physics of attached element do not affect the element it's attached to. As a result, it acts line an object of infinite mass. When it intersects other objects of infinite mass, they go through each other. But if it collides an element of a finite mass (such as a vehicle), that element gets pushed with no effort.
-
Unless I have missed something, there's nothing in the script what could prevent it from working. Maybe you didn't set it to client-sided in meta.xml? And if you want to prevent some weapons from inflicting damage, there's no need to make a long condition check. Better use tables for that. Instead of doing this: if value == 5 or value == 9 or value == 11 then You can make a table of values (usually at the top of the script): validValues = { [5] = true, [9] = true, [11] = true } And check the condition in this way: if validValues[value] then
-
k is the key in your loop. That means, it has values 'w1', 'w2' and 'w3' during iterations.The problem is that you try converting these values to numbers. That fails and tonumber function returns nil.