BonSay~^ Posted July 25, 2015 Posted July 25, 2015 Ola eu gostaria de alterar o dano da sniper do meu servidor para matar com 1 tiro eu sei que tem que usar setweaponproperty mas nao sei montar o script alguem me ajuda !! Daqui pra frente vai ser tudo diferente ♫ ♩
#RooTs Posted July 25, 2015 Posted July 25, 2015 tem um script que já vem com o MTA ( headshot ) só ligar ele, e atirar com qualquer arma na cabeça do jogador. apenas 1 tiro na cabeça
BonSay~^ Posted July 26, 2015 Author Posted July 26, 2015 tem um script que já vem com o MTA( headshot ) só ligar ele, e atirar com qualquer arma na cabeça do jogador. apenas 1 tiro na cabeça Eu quero que mate em qualquer parte do corpo nao so na cabeça Daqui pra frente vai ser tudo diferente ♫ ♩
RenanPG Posted July 26, 2015 Posted July 26, 2015 tem um script que já vem com o MTA( headshot ) só ligar ele, e atirar com qualquer arma na cabeça do jogador. apenas 1 tiro na cabeça Eu quero que mate em qualquer parte do corpo nao so na cabeça (client-side) local weapons = {20, 40} -- id da arma function onClientPedDamage(_, weapon) if(getElementType(source) == "player") then if(weapons[weapon]) then return killPed(source) end end end addEventHandler("onClientPedDamage", getRootElement(), onClientPedDamage)
n3wage Posted July 26, 2015 Posted July 26, 2015 (client-side) local weapons = {20, 40} -- id da arma function onClientPedDamage(_, weapon) if(getElementType(source) == "player") then if(weapons[weapon]) then return killPed(source) end end end addEventHandler("onClientPedDamage", getRootElement(), onClientPedDamage) killPed é server side apenas. -- for _, v in ipairs ( { "pro", "std", "poor" } ) do setWeaponProperty ( "sniper", v, "damage", 9999 ) end
xeon17 Posted July 27, 2015 Posted July 27, 2015 (edited) -- Client addEventHandler('onClientPlayerDamage', localPlayer, function (attacter,weapon,bodypart) if (attacter and weapon == 34 and bodypart == 9) then triggerServerEvent('killPlayer',source) end end) -- Server addEvent('killPlayer', true) addEventHandler ('killPlayer', root, function () killPed(client) end) Edited July 28, 2015 by Guest A unique GangWar gamemode waiting for you!Click here for more information.
RenanPG Posted July 27, 2015 Posted July 27, 2015 Hornet noob -- Client addEventHandler('onClientPlayerDamage', localPlayer, function (attacter,weapon,bodypart) if (attacter and weapon == 69 and bodypart == Head) then triggerServerEvent('killPlayer',source) end end) -- Server addEvent('killPlayer', true) addEventHandler ('killPlayer', root, function () killPed(client) end) O id da arma está incorreto, pegue os ids necessários aqui: https://wiki.multitheftauto.com/wiki/Weapon.
RenanPG Posted July 27, 2015 Posted July 27, 2015 (client-side) local weapons = {20, 40} -- id da arma function onClientPedDamage(_, weapon) if(getElementType(source) == "player") then if(weapons[weapon]) then return killPed(source) end end end addEventHandler("onClientPedDamage", getRootElement(), onClientPedDamage) killPed é server side apenas. -- for _, v in ipairs ( { "pro", "std", "poor" } ) do setWeaponProperty ( "sniper", v, "damage", 9999 ) end Como não? é so cria -__- function killPed( p) return setElementHealth(p,0) end
RenanPG Posted July 27, 2015 Posted July 27, 2015 @XeoN- Seu código ainda tem erros, não acho que seja necessário chamar o roots para isso.
xeon17 Posted July 27, 2015 Posted July 27, 2015 @XeoN- Seu código ainda tem erros, não acho que seja necessário chamar o roots para isso. o que ta errado filho? A unique GangWar gamemode waiting for you!Click here for more information.
RenanPG Posted July 27, 2015 Posted July 27, 2015 @XeoN- Seu código ainda tem erros, não acho que seja necessário chamar o roots para isso. o que ta errado filho? Head deveria ser o id. if (attacter and weapon == 69 and bodypart == Head) then
xeon17 Posted July 27, 2015 Posted July 27, 2015 @XeoN- Seu código ainda tem erros, não acho que seja necessário chamar o roots para isso. o que ta errado filho? Head deveria ser o id. if (attacter and weapon == 69 and bodypart == Head) then Na verdade precisa ser 9 e voce ta precisando aulas do roots amigo. A unique GangWar gamemode waiting for you!Click here for more information.
#RooTs Posted July 27, 2015 Posted July 27, 2015 Xeon troque o "attacter" por "attacker" sua linha está if (attacter and weapon == 69 and bodypart == Head) then atualizada fica if (attacker and weapon == 69 and bodypart == Head) then se caso tiver mais algum erro, revisa o seu roteiro
RenanPG Posted July 27, 2015 Posted July 27, 2015 Xeon troque o "attacter" por "attacker" sua linha está if (attacter and weapon == 69 and bodypart == Head) then atualizada fica if (attacker and weapon == 69 and bodypart == Head) then se caso tiver mais algum erro, revisa o seu roteiro Não corrige mano, xeon não aprende.
xeon17 Posted July 27, 2015 Posted July 27, 2015 Xeon troque o "attacter" por "attacker" sua linha está if (attacter and weapon == 69 and bodypart == Head) then atualizada fica if (attacker and weapon == 69 and bodypart == Head) then se caso tiver mais algum erro, revisa o seu roteiro Isso nao e erro amigo, e apenas o nome e o codigo fuciona bem com attacter e attacker A unique GangWar gamemode waiting for you!Click here for more information.
#RooTs Posted July 27, 2015 Posted July 27, 2015 Isso nao e erro amigo, e apenas o nome e o codigo fuciona bem com attacter e attacker não sabia disso vlw por me explicar
Tremidinha Posted July 27, 2015 Posted July 27, 2015 o god... function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged if ( bodypart == 9 and weapon == 34) then -- if the body part is 9, i.e. the head outputChatBox ( "Headshot!", getRootElement (), 255, 170, 0 ) --output "Headshot" into the chatbox killPed ( source, attacker, weapon, bodypart ) -- and kill the player end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) https://wiki.multitheftauto.com/wiki/OnPlayerDamage Email - [email protected] Skype - mattheusxdx
BonSay~^ Posted July 27, 2015 Author Posted July 27, 2015 Poxa alguem pode me mandar o script que mate com a sniper com apenas 1 tiro em qualquer parte do jogador obg ate agr so vi gente brigando U.u Daqui pra frente vai ser tudo diferente ♫ ♩
xeon17 Posted July 27, 2015 Posted July 27, 2015 Poxa alguem pode me mandar o script que mate com a sniper com apenas 1 tiro em qualquer parte do jogador obg ate agr so vi gente brigando U.u ta ai amigo -- Client addEventHandler('onClientPlayerDamage', localPlayer, function (attacter,weapon,bodypart) if (attacter and weapon == 34 and bodypart == 9) then triggerServerEvent('killPlayer',source) end end) -- Server addEvent('killPlayer', true) addEventHandler ('killPlayer', root, function () killPed(client) end) A unique GangWar gamemode waiting for you!Click here for more information.
Banex Posted July 27, 2015 Posted July 27, 2015 function onPlayerDamage(attacker, weapon, bodypart) if attacker and weapon == 34 then killPed(source, attacker, weapon, bodypart) end end addEventHandler("onPlayerDamage",root,onPlayerDamage) Not worry about the future. Very soon it will come.
xeon17 Posted July 27, 2015 Posted July 27, 2015 function onPlayerDamage(attacker, weapon, bodypart) if attacker and weapon == 34 then killPed(source, attacker, weapon, bodypart) end end addEventHandler("onPlayerDamage",root,onPlayerDamage) O Tremidinha postou o mesmo codigo, pra que postar dois vezez a mesma coisa amigo? voce sabia que double-post e proibido aqui? obs: seu avatar e muietito bueno A unique GangWar gamemode waiting for you!Click here for more information.
BonSay~^ Posted July 27, 2015 Author Posted July 27, 2015 function onPlayerDamage(attacker, weapon, bodypart) if attacker and weapon == 34 then killPed(source, attacker, weapon, bodypart) end end addEventHandler("onPlayerDamage",root,onPlayerDamage) Vlw mano deu certo Daqui pra frente vai ser tudo diferente ♫ ♩
Recommended Posts