Wisam Posted May 8, 2014 Posted May 8, 2014 I have a small team friendly fire script it makes the fire unharmful for teammates, and i wanted to add a new feature, its teammates cant damage each other's vehicles (when its being driven) Script: function protect() for i, TEAMS in ipairs ( getElementsByType("team") ) do if ( getTeamFriendlyFire ( TEAMS ) == true ) then setTeamFriendlyFire ( TEAMS, false ) end end end addEventHandler("onResourceStart", resourceRoot, protect) ☣ Plauge Arma II DayZ Mod Server ☣ Here's the link to stay tuned with the server progress and features: https://forum.mtasa.com/viewtopic.php?f=114&t=96675 Get Ready to play DayZ like you never did before
Snow-Man Posted May 8, 2014 Posted May 8, 2014 if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) end and you getPedOccupiedVehicle USC Informations Head Staff & Owner Of USC. Youtube Channel : My Channel
Wisam Posted May 8, 2014 Author Posted May 8, 2014 What do you mean? ☣ Plauge Arma II DayZ Mod Server ☣ Here's the link to stay tuned with the server progress and features: https://forum.mtasa.com/viewtopic.php?f=114&t=96675 Get Ready to play DayZ like you never did before
TAPL Posted May 9, 2014 Posted May 9, 2014 Try this and let me know if it worked. Client Side: addEventHandler("onClientVehicleDamage", root, function(attacker) if attacker and getElementType(attacker) == "player" then local driver = getVehicleController(source) if driver then local attackerTeam = getPlayerTeam(attacker) local driverTeam = getPlayerTeam(driver) if attackerTeam and driverTeam and attackerTeam == driverTeam then cancelEvent() end end end end)
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