fireBRZ Posted April 1, 2019 Share Posted April 1, 2019 Como faço para setar um dano de uma arma ,mais nao pelo client e sim pelo server ??? 1 Link to comment
LucasMTA Posted April 2, 2019 Share Posted April 2, 2019 Eu uso isso para definir um certo limite de dano em minhas armas. Ele funciona em serve-side Nesse código ele fornece 100 dano para sniper ID. 34 addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) end end end ) local weapons = {34} function onClientPedDamage(_, weapon) if(getElementType(source) == "player") then if(weapons[weapon]) then return killPed(source) end end end addEventHandler("onClientPedDamage", getRootElement(), onClientPedDamage) for _, v in ipairs ( { "pro", "std", "poor" } ) do setWeaponProperty ( "sniper", v, "damage", 100 ) end 1 Link to comment
Other Languages Moderators Lord Henry Posted April 2, 2019 Other Languages Moderators Share Posted April 2, 2019 Só com isso já serve. for _, v in ipairs ( { "pro", "std", "poor" } ) do setWeaponProperty (ID, v, "damage", 0) -- No lugar de ID, coloque o ID da arma que vc quer mudar o dano. No lugar do 0, informe quanto dano cada tiro da arma deverá dar. end 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now