Sign in to follow this  
Drakath

Friendly fire

Recommended Posts

Post the script.

Share this post


Link to post
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end 

Share this post


Link to post

Is 'allTeams' defined somewhere? And what event is this triggered by?

Share this post


Link to post
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        local allTeams = getElementsByType ( "team" ) 
        for index, theTeam in ipairs ( allTeams ) do 
            setTeamFriendlyFire ( theTeam, false ) 
        end 
    end 
) 

Share this post


Link to post

like this:

addEventHandler("onResourceStart",resourceRoot,function() 
    createTeam("Default") 
end) 
addEventHandler("onPlayerJoin",root,function() 
    setPlayerTeam(source,getTeamFromName("Default")) 
end) 

Share this post


Link to post

This script you gave me doesn't work. It only works when player joins but when he logs in the team is gone...

Share this post


Link to post

Sorry, but we shouldn't be creating these scripts for you,

use onPlayerLogin so, when they login, you could set their team to the default team.

Share this post


Link to post

I am using "onPlayerLogin" but it steal doesn't work. There is no players in this team...

Share this post


Link to post
addEventHandler("onResourceStart",resourceRoot,function() 
    createTeam("All") 
end) 
addEventHandler("onPlayerLogin",root,function() 
    setPlayerTeam(source,getTeamFromName("All")) 
end) 

Share this post


Link to post

That's all your script?

well, try this:

addEventHandler("onResourceStart",resourceRoot,function() 
    teamAll= createTeam("All") 
end) 
  
addEventHandler("onPlayerLogin",root,function() 
    setPlayerTeam(source,teamAll) 
end) 

Edited by Guest

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.