-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Also without mods? There are some mods that do have some collision issues.
-
You mean that there is no damage given? If that is the case: You could maybe use: https://wiki.multitheftauto.com/wiki/OnClientPlayerWeaponFire to save the latest player shot and set that as attacker. (with some tricks)
-
Either the vehicle component has no orientation (or maybe the vehicle is streamed out or something else...). if x and y and z then end And if none of components work, then I have no idea.
-
You didn't mess anything up, but it seems the function has been broken somewhere on the versioooon-way. The wiki example didn't work either. local baseElement = createElement("map-dinner") --[[ ]] local element = createObject ( 1337, 5540.6654, 1020.55122, 1240.545, 90, 0, 0 ) setElementParent(element, baseElement) --[[ ]] local file = xmlCreateFile ("map.xml", "map") saveMapData ( file, baseElement, true ) xmlSaveFile ( file ) xmlUnloadFile ( file ) --[[ <map> <object></object> </map> ]] local file = xmlCreateFile("saved.map", "map") if file then saveMapData ( file, getResourceRootElement(getThisResource()), true ) xmlSaveFile ( file ) xmlUnloadFile ( file ) end --[[ <map> <map> <map-dinner> <object></object> </map-dinner> </map> </map> ]] I am going to add a bug report. https://github.com/multitheftauto/mtasa-blue/issues/1473
-
An alternative is to save an specific part of the element tree. Pick the method that works best for you. local file = xmlCreateFile ("map.xml", "map") local baseElement = createElement("temporary") --[[ ]] local element = -- createObject, createVehicle, etc. etc, setElementParent(element, baseElement) --[[ ]] saveMapData ( file, baseElement ) xmlSaveFile ( file ) xmlUnloadFile ( file ) destroyElement(baseElement) -- destroy every element, parent as well as the children thanks to propagation Pro's Flexibility, you do not have to write specific code for other elements. Cons: Serverside only No custom properties with special characters, for example : notations and code comments on the fly. All properties are copied, you do not have fully control which ones are saved.
-
Looks very nice! ? Btw. you have currently tagged your topic as [SHOW], you might want to consider change it to [REL] since you actually released it.
- 14 replies
-
- 1
-
-
- mstu
- multi slection tool
-
(and 1 more)
Tagged with:
-
dano = {} function bloquear(source) dano[source] = 1 setTimer(tirar,8000,1,source) end addEventHandler ( "onPlayerDamage", root, bloquear ) function tirar(source) dano[source] = 0 end function clientPickupHit(thePlayer,pickup, matchingDimension) local pickupType = getPickupType( source ) if (dano[player] == 1) then if (pickupType == 0) or (pickupType == 1) then outputChatBox("Não é possivel pegar pickup em combate!",player, 255, 0, 0) cancelEvent() end end end addEventHandler("onPickupHit", root, clientPickupHit)
-
You can't use triggerClientEvent to return values. Only MTA-Communication-Enchantment can do that with a callback, like this: And I am not even sure that you need to do that, you can already provide that information on your first triggerServerEvent. triggerServerEvent("GiveWeaponToPlayer", root, Ammo) addEvent("GiveWeaponToPlayer", true) addEventHandler("GiveWeaponToPlayer", root, function(Ammo_) local prl = client giveWeapon(prl, 22, Ammo_, true) end)
-
Maybe, there is no information about console being available here: https://wiki.multitheftauto.com/wiki/ExecuteCommandHandler So I am not sure if that is supported. But if you want to try that, you need to provide the element console and not the string "console".
-
Wiki doesn't indicates that the client version of the event can be cancelled. https://wiki.multitheftauto.com/wiki/OnClientPickupHit While on serverside there is an indication: Cancel effect If this event is canceled, the pickup does not disappear and the player does not receive its bonus. https://wiki.multitheftauto.com/wiki/OnPickupHit So you will have to create it on serverside. dano = {} local player = source -- ... dano[player] = true -- block dano[player] = nil -- unblock / clear if dano[player] then end
-
Set it to 2000, not 10000.
-
Afaik the max vehicle health is +/- 2000. (Initial health is 1000.)
-
Basic example: (but doesn't work very well with multiple players, since serverside is 1 environment and clientside an environment per player) triggerServerEvent ( "setAmmo", resourceRoot, Ammo) addEvent("setAmmo", true) addEventHandler("setAmmo", resourceRoot, function (Ammo_) Ammo = Ammo_ end, false)
-
Not likely, since that only will work when there is an admin online which you can use as executor. https://wiki.multitheftauto.com/wiki/Element/Console It is better to solve that at the source: local console = getElementChildren ( root, "console")[1] addCommandHandler ( "somecommand", function ( playerSource, commandName ) if console == playerSource or --[[ ACL check]] then end end) Option A local console = getElementChildren ( root, "console")[1] if console == playerSource then end Option B if getElementType(playerSource) == "console" then end
-
I have uploaded an uncompiled version. Because compiled scripts are not healthy for developers. ?
- 14 replies
-
- 1
-
-
I have uploaded it to the community so that it is now better accessible for everybody. ? https://community.multitheftauto.com/index.php?p=resources&s=details&id=18170
- 28 replies
-
- 1
-
-
- trains
- not compiled
-
(and 2 more)
Tagged with:
-
That is not it. hmmm Maybe: testLineAgainstWater https://wiki.multitheftauto.com/wiki/TestLineAgainstWater
-
Either the anti cheat (DayZ) or a custom damage script (DayZ). Try to search for getPedOxygenLevel inside of all the scripts from DayZ. Or search for isElementInWater instead. And try to disable it there. With notepad++ you can search in directories instead of file by file. (But make sure to filter on .Lua files only, else you will also be searching inside of binary files like images and mods, which takes long...)
-
Not sure to be honest. 4 should be fine. If you run out of VRAM, it could be possible for the rendertarget to fail. Not sure what kind of hardware you use. iprint(dxGetStatus ().VideoMemoryFreeForMTA) https://wiki.multitheftauto.com/wiki/DxGetStatus Also checking for an texture memory leak isn't a bad idea. iprint(#getElementsByType("texture")) -- should be showing the total textures from all resources
-
As Bonsai said about creating it once. You currently have created a memory leak, which might play a role in this strange behaviour. A render target is an element, which is attached to the element tree, not just a value you can overwrite. In your case you might want to destroy it first, every time you display new top times (since your height is variable). if isElement(toptimesRT) then destroyElement(toptimesRT) end toptimesRT = dxCreateRenderTarget(sizeX,sizeY,true)
-
It is not possible when the vehicle is damageproof, unless you use events that are fired before the damage, like onClientPlayerWeaponFire and onClientVehicleCollision.
-
That condition you use inside of your loop is not very useful. All items have item text, even if they are empty. And your gridlist doesn't update, because you are not updating it with the right function. https://wiki.multitheftauto.com/wiki/GuiGridListSetItemText If you want to update just the label, that loop is not required. Make sure you save each sub table on to an item. Then you can get the selected item and get the data from it. https://wiki.multitheftauto.com/wiki/GuiGridListSetItemData https://wiki.multitheftauto.com/wiki/GuiGridListGetItemData
-
trigger Help with TriggerServerEvent Client/Server Not Working
IIYAMA replied to senior penguin's topic in Scripting
This looks like it is a leaked resource. If it is not, send me a pm with the link to the source for verification. Source verified: https://github.com/ESX-Org/esx_vehicleshop- 1 reply
-
- triggerserverevent
- help
- (and 5 more)
