-
Posts
1,461 -
Joined
-
Last visited
-
Days Won
34
Everything posted by DiSaMe
-
getElementMatrix setElementMatrix
-
Makes no sense. Replaces destroyElement by a function which sets its own local variable to nil, therefore doing absolutely nothing.
-
If Ped is defined, then it probably works fine - it correctly draws the text outside the screen You use screen width as Y coordinate and that is under the bottom of the screen.
-
The handler will be removed.
-
DX drawings are not GUI elements. DX drawings do not exist. DX functions do not create anything and because of that, they do not return any element. All what DX functions do is changing the colors of pixels on the screen. Our brains receive the information about these pixels and interpret some areas as distinct objects, creating an illusion of DX drawings' existence
-
getVehicleTowingVehicle Isn't that what you actually need?
-
The X coordinate is -3000 on the edge of the western side and 3000 on the east. The Y coordinate is -3000 in the south and 3000 in the north.
-
According to the meta.xml page, the caching option is only for scripts. To prevent other files from being saved, you can make a script which deletes them using a function: fileDelete But whatever is not saved has to be redownloaded every time when joining the server. Not really good for vehicle mods. The best possible approach is probably encryption. You upload the encrypted files to the server, then send the key using triggerClientEvent and the client-side script uses it to decrypt the content (using the file functions). This way only the key will have to be resent every time and it's not much. Anyway, there's no 100% reliable way to prevent the client-side files from getting stolen. Whatever appears on the client must have to be downloaded by the client.
-
Because you're trying to get element which the player is attached to. To get the elements which are attached to the player, use this function: getAttachedElements But I'd recommend to use tables to keep information which player the blip belongs to. Then you can just take the blip value out of the table and destroy it when the player quits. In addition, you're needlessly getting the name of the player and then getting the player from name. Lines with getPlayerName and getPlayerFromName could be simplified to an expression: player = source And finally, it's better to make the variables local by using the 'local' keyword. Local variables are faster and only exist in the scope they were created in (such as function). So the code should look something like this: player_blips = {} --creating a table function playerJoin() local blip = createBlipAttachedTo(source) player_blips[source] = blip --storing the blip into the table under the player element key end addEventHandler("onPlayerJoin", root, playerJoin) function playerQuit() local blip = player_blips[source] --retrieving the blip from the table destroyElement(blip) player_blips[source] = nil --since we don't need the information about the blip in the table anymore, we remove it to free the memory end addEventHandler("onPlayerQuit", root, playerQuit)
-
Those "control lists" aren't even "lists". Every control is specific, most of the time only having an effect either on foot or in the vehicle. That doesn't even have much to do with MTA - it's the way GTA SA itself works. If the same controls were used, then they would have the same input bindings too. What's more important, setPedControlState function itself is for usage both on foot and in the vehicle. Universal functions are better. Having multiple different attachment functions for every combination of elements isn't as good and simple as single function attachElements is. So why make the ped aiming different?
-
This is so great. Incredible. I want it in MTA so much - I made a program which converts LC and VC from GTA3 and GTA VC to MTA, but since MTA keeps crashing or just working improperly with many custom models loaded, I can't test everything and until I do this, I will probably not release that program. MTA:Eir would allow us to have LC, VC and SA all in one map, right?
-
Oops, sorry, didn't read carefully.
-
Leaning reduces the air resistance, so that's completely logical.
-
I don't see any reason why making another function is better than fixing the existing one. What would the outcome be? A function which works improperly in the vehicle and another function which doesn't work on foot? Doesn't sound really good. Such as?
-
trying to make a drive-by ped have some precision [help]
DiSaMe replied to HeavyMetal's topic in Scripting
setPedAimTarget is supposed to make the ped aim at the point, either on foot or while doing a drive-by, but it doesn't work properly in the latter case. It's a bug. -
When you're firing the weapon, the ammo of the flamethrower decreases slowly and a momentary shot may not decrease the ammo shown in the HUD. But 10 momentary shots will. The point is, the game shows 10 times less of the flamethrower ammo than there truly is - that's how the HUD works. The problem arises from inconsistency between the weapon give/ammo get functions. Weapon giving functions measure the ammo in the same way the HUD does, while ammo get functions use the actual ammo value.
-
If I understand you correctly, you need MTA anti-cheat to read the players' minds and find out whether they're intentionally causing the lag or not. This cannot be done - first, it needs special hardware to read the signals from the brain, and second, processing these signals into usable information needs a lot of work
-
That's because you're creating the table before creating the functions.
-
setElementStreamable
-
Then why make huge downloads before playing instead of downloading them during the gameplay?
-
0x000010 is a number. 0x000010 is 16. Debugscript clearly says what the problem is. You missed the property name (should be "flags") in your case and used the value (which should be the 4th argument) in its place.
-
local Table = {0.1, 0.3, -0.15}
-
This question isn't directly related to MTA, but since I have plans to do something in MTA, I'm asking here. Although mods which bring the map of one game to another (such as Liberty City in GTA SA) are pretty common, I still want to ask to be sure. Is it completely legal to make such mods freely available to download? I mean, the map makes up a big part of the game's content, so converting it to the other game's format and uploading it is not so much different from uploading the game itself. I would like to try putting the Liberty City and Vice City from GTA3 and GTA VC into MTA server, but is it legal to simply upload the map models and textures converted to GTA SA format or is there anything else I need to take care of?
-
Wake up! SA-MP does not have and never had an ability to use CJ clothes as objects. There's nothing to be jealous of, as MTA has everything what's needed for this. You can import custom objects with engine functions.
-
When you set the value of the field to nil, that field is removed, so the memory will be freed. That's the point of nil - it is a way to represent the absence of the value. That's the reason why you get nil from non-existing variables or uninitialized fields of the table. If nil didn't have such special behavior, it would be not different from false, therefore an useless duplicate.
