Moderators IIYAMA Posted March 13, 2012 Moderators Posted March 13, 2012 Hello My Question: Is it possible to let 1 player kill another player by script? I mean a kind of slap script that slaps this player by another player. It must be also visible in killmessage. Player > kills > Player. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Castillo Posted March 13, 2012 Posted March 13, 2012 killPed has 'killer' argument. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators IIYAMA Posted March 13, 2012 Author Moderators Posted March 13, 2012 but it is not possible to set damage? They must be make a handler..... onElementDamage... -_-" or onElementGetHitByExplosion.. damn... Damn I love the resource syncro with its damage syncs... Only I hate the anti bug use script. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Agon Posted March 14, 2012 Posted March 14, 2012 Well if you want to kill a player, why do you want to set its health? Just kill him..
Moderators IIYAMA Posted March 14, 2012 Author Moderators Posted March 14, 2012 hmmm Well I was building a anti teamkill fire(motove) script. So I checked the owner of the explosion. Checked distance and slapped it. This did not work. (no attacker) But I have a better idea now. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Agon Posted March 14, 2012 Posted March 14, 2012 Maybe this? function slapHim (attacker, weapon, victim) if ( weapon == 38 ) then -- 38 is minigun sorry i dont remember molotove if getElementType(victim) == "player" then setElementHealth(attacker, getElementHealth(attacker) - 20) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), slapHim)
Moderators IIYAMA Posted March 14, 2012 Author Moderators Posted March 14, 2012 function slapHim (attacker, weapon, bodypart) if ( weapon == 37 ) then -- it is 37(flame weapon) The motovo weapon it self is not a weapon that makes damage. setElementHealth(attacker, getElementHealth(attacker) - 20) end end addEventHandler("onClientPlayerDamage", getLocalPlayer(), slapHim) And no your wrong this script does not work. Because attackers don't exist with weapon 37. see: http://bugs.mtasa.com/view.php?id=4925 For now it s only syncro that can sync that. But I am going to try it on a easy way. Syncro by Bigbadbutler (chaose) https://community.multitheftauto.com/index.php?p= ... ls&id=1065 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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