goofie88 Posted October 27, 2012 Share 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 ) Link to comment
TAPL Posted October 27, 2012 Share Posted October 27, 2012 https://wiki.multitheftauto.com/wiki/SetTeamFriendlyFire Link to comment
Renkon Posted October 27, 2012 Share Posted October 27, 2012 for _,t in ipairs(getElementsByType("team")) do setTeamFriendlyFire ( t , false ) end Link to comment
goofie88 Posted October 27, 2012 Author Share Posted October 27, 2012 thank you very much, works! Link to comment
goofie88 Posted October 28, 2012 Author Share 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 Link to comment
TAPL Posted October 28, 2012 Share Posted October 28, 2012 https://wiki.multitheftauto.com/wiki/OnClientPlayerHeliKilled Link to comment
goofie88 Posted November 2, 2012 Author Share 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 Link to comment
50p Posted November 3, 2012 Share 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. Link to comment
FeniXMTA Posted July 18, 2018 Share 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) Link to comment
MandaBraza Posted July 18, 2018 Share 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 Link to comment
Storm-Hanma Posted July 18, 2018 Share Posted July 18, 2018 Community already having no team kill script you can use it Link to comment
FeniXMTA Posted July 18, 2018 Share 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. 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