goofie88 Posted October 27, 2012 Posted October 27, 2012 hello I wanted to make an anti-team kill but it's not working function team ( attacker, weapon, bodypart, loss ) local attacker = getPlayerTeam ( source ) local victim = getPlayerTeam ( attacker ) if ( attacker == victim) then cancelEvent () end end addEventHandler ( "onPlayerDamage", getRootElement (), team )
TAPL Posted October 27, 2012 Posted October 27, 2012 https://wiki.multitheftauto.com/wiki/SetTeamFriendlyFire
Renkon Posted October 27, 2012 Posted October 27, 2012 for _,t in ipairs(getElementsByType("team")) do setTeamFriendlyFire ( t , false ) end
goofie88 Posted October 28, 2012 Author Posted October 28, 2012 but I still have a problem People can kill with helis (exemple: seasparrow) please could you help me and they can destroy my car
TAPL Posted October 28, 2012 Posted October 28, 2012 https://wiki.multitheftauto.com/wiki/OnClientPlayerHeliKilled
goofie88 Posted November 2, 2012 Author Posted November 2, 2012 hello sorry for bump but I have a problem with teamkill when used with medic, seems friendlyfire disabled any hit and now you cant heal with flowers here's medic script Client function stopDamage ( theplayer , attacker, weapon, bodypart ) cancelEvent() end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) Server function heal (attacker, attackerweapon, bodypart, loss) hp = getElementHealth (source) if (attackerweapon == 14) and (loss > 1) and ( hp < 99 ) then setElementHealth ( source, hp + 15 ) end end addEventHandler ("onPlayerDamage", getRootElement(), heal ) and how to make friendlyfire for 2 teams, exemple if team A shoot team B then no damage
50p Posted November 3, 2012 Posted November 3, 2012 Triple-post again and we will take actions. Friendly fire means shooting team members. You can't simply disable friendly fire for members of 2 teams because members of other team are not "friends" (where the name comes from "friendly fire"). You cancel onClientPlayerDamage, why would you expect to receive any damage including flower damage? Think about it.
FeniXMTA Posted July 18, 2018 Posted July 18, 2018 Tenho essa funçao de Ant-Kill,mais ela é por Team queria passar para Acl,como faço ? function createTeamsOnStart ()local allTeams = getElementsByType ( "team" )for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == true ) then setTeamFriendlyFire ( theTeam, false ) endendendaddEventHandler("onResourceStart", resourceRoot, createTeamsOnStart)
MandaBraza Posted July 18, 2018 Posted July 18, 2018 (edited) 11 minutes ago, FeniXMTA said: Tenho essa funçao de Ant-Kill,mais ela é por Team queria passar para Acl,como faço ? function createTeamsOnStart ()local allTeams = getElementsByType ( "team" )for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == true ) then setTeamFriendlyFire ( theTeam, false ) endendendaddEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) team = createTeam("MINHA TEAM", 255, 165, 0) addEventHandler("onPlayerLogin", root, function() local account = getAccountName(getPlayerAccount(source)) if (isObjectInACLGroup("user." ..account, aclGetGroup("teamName"))) then -- "teamName" é o nome do seu grupo que você criou na acl. setPlayerTeam(source, team) setTeamFriendlyFire(team, false) end end) addEventHandler("onPlayerLogout", root, function() setPlayerTeam(source, nil) end) Edited July 18, 2018 by MUR1LLO
Storm-Hanma Posted July 18, 2018 Posted July 18, 2018 Community already having no team kill script you can use it
FeniXMTA Posted July 18, 2018 Posted July 18, 2018 13 minutes ago, KINGKHAN said: Comunidade já não tem script de matar a equipe você pode usá-lo Não entendi mano.
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