Gang

Location

Occupation

Interests

Regeneration (health)
This resource lets you regenerate player and vehicle* health. It is not an unique idea, I know... but there weren't good implementations for it at the community resource list. So that's why I share this with YOU.
* Vehicle regeneration for the driver only.
Version 1.0.0
Not compiled!
Smooth health regeneration
No UI, just the manager
Settings (Admin panel)
Settings
Regeneration [on/off] (player/vehicle)
Regeneration value (player/vehicle)
Regeneration delay (player/vehicle)
Regeneration [on/off] while the vehicle is burning
Download link:
https://community.multitheftauto.com/?p=resources&amp;s=details&amp;id=15757
Take a quick look into the source code (v1.0.0)
Client
Server
Meta

Hello,
I'm trying to pass my server side settings defined in my meta.xml to the client. However, when passing the table of XML data to the client, the data does not persist.
Here's my server side code:
addEvent("onClientRequestResourceSettings", true)
addEventHandler("onClientRequestResourceSettings", resourceRoot,
function()
local xml = xmlLoadFile("meta.xml")
local settingsNode = xmlFindChild(xml, "settings", 0)
if(settingsNode) then
local settings = xmlNodeGetChildren(settingsNode)
triggerClientEvent(client, "onServerProvideResourceSettings", resourceRoot, settings)
end
xmlUnloadFile(xml)
end
)
That above event is called client side when the resource starts.
Here's the client side code:
addEvent("onServerProvideResourceSettings", true)
addEventHandler("onServerProvideResourceSettings", resourceRoot,
function(theSettings)
iprint("Settings provided: "..inspect(theSettings)) --Output: "Settings provided: { }"
end
)
However my settings table is not being passed to the client. When printing the output, it appears to be an empty table. I'm aware there is a limitation of passing xml data to the client, however as this is in fact a table data type, I wouldn't of thought there would be an issue?
Can anyone point me in the right direction, or perhaps provide some better solutions for passing settings data from the meta.xml to the client?
Cheers.

Hello!
I have a server and lot of player complaining, because the bullet sync is bad.
If i have little FPS, other players can't kill me. (very difficult)
How can i fix that problem?
Whit this MTA settings, maybe?
- bullet_sync
- player_sync_interval
- ped_syncer_distance
- latency_reduction
What is the best settings?

Hello everyone.
I have a script with some settings that can be changed on Admin Panel, they are working fine without any error.
The settings are declared on meta.xml like this:
<settings>
<setting name="*playerHouseCounter" value="[1]" friendlyname="Número de casas por jogador" group="General" accept="1-5" desc="Quantas casas cada jogador pode ter ao mesmo tempo." />
<setting name="*keyVipLength" value="[4]" friendlyname="Número mínimo de caracteres na senha" group="General" accept="1-10" desc="Quantos caracteres no mínimo devem ter as senhas das casas." />
<setting name="*vipACL" value="Vip" friendlyname="ACL Group VIP" group="General" accept="*" examples="Premium, VIP, vips, Payers, Pay2Play, etc" desc="Nome exato da ACL Group dos jogadores que são VIPs." />
</settings>
BUT
When I change a setting (from 1 to 2 as example), it appears duplicated with the new value, like this:
In the script, I get those values with this:
get( 'playerHouseCounter' )
How can I do this? This error doesn't happens with original resources.

I have a gun sight system, but it keeps warning me when I click to aim ('Mouse2') I did a function to see if the error was going to go I'm going to put the old script and what I did PLEASE WHAT SHOULD I DO?
old
bindKey("mouse2","down",function()
Crosshair_table = {}
if getElementData(getLocalPlayer(),"sight") then
if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then
return
end
defaults = dxCreateTexture(getElementData(getLocalPlayer(),"sight"))
oldSight = getElementData(getLocalPlayer(),"sight")
Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx")
engineApplyShaderToWorldTexture(Crosshair_table, "siteM16")
dxSetShaderValue(Crosshair_table, "gTexture", defaults)
end
end)
I did
bindKey("mouse2","down",function()
Crosshair_table = {}
if getElementData(getLocalPlayer(),"sight") then
if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then
return
end
if default then
default = getElementData(getLocalPlayer(),"sight")
else
default = "utilitarios/painel/images/false.png"
end
local defaults = dxCreateTexture(default)
local oldSight = getElementData(getLocalPlayer(),"sight")
Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx")
engineApplyShaderToWorldTexture(Crosshair_table, "siteM16")
dxSetShaderValue(Crosshair_table, "gTexture", defaults)
end
end)
Warning that this is the one: bad argument @'dxcreateTexture' [expecte mumber at argument 2, got none]
Thank you in advance;)

Hi, I got a problem with the "settings" on my script. I set in the meta the following:
<settings>
<setting
name="*skinsPrice"
value="2500"
group="Price"
desc="Set the price of the skins."
/>
</settings>
But when I try to edit the value I got this error:
Basically, if I edit one, another setting is created with the value I set, and the old setting is not changed.
If I use get() function like this:
function saveSkinPrice (skinsResource)
if skinsResource ~= getThisResource() then return end
local currentSkinPrice = get("skinsPrice")
--I use the setElementData to retrieve the value on client side
setElementData(resourceRoot, "skins.price", currentSkinPrice )
end
addEventHandler("onResourceStart", getRootElement(), saveSkinPrice)
function updateSkinPrice(pricesetting, oldprice, newprice)
--outputs for testing
outputChatBox(pricesetting)
outputChatBox(oldprice)
outputChatBox(newprice)
local currentSkinPrice = get("skinsPrice")
setElementData(resourceRoot, "skins.price", currentSkinPrice )
end
addEventHandler("onSettingChange", getRootElement(), updateSkinPrice)
It retrieve the value from "iG_infernus-skins.skinsPrice" setting, making the setting "skinsPrice" useless. I can only use it to edit the "iG_infernus-skins.skinsPrice" setting, and that doesn't have any sense.