Jump to content

how i make anti team damage


IIIIlllllIII

Recommended Posts

Posted
team1 = createTeam("Team 1", 255, 0, 0) 
setTeamFriendlyFire(team1, false) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)

if you allready created the teams just put this :

setTeamFriendlyFire(eJraM, false) 
setTeamFriendlyFire(MaFia, false) 

That's the same script as his, you're trying to increase your post count I guess.

No i'm Not

Edited by Guest
Posted

That's the same script as his, you're trying to increase your post count I guess.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

for some reason, the returned value from createTeam cannot be used when trying to use team functions,

using getTeamFromName should work, like the post above me did.

Posted

Server.lua:

  
local t1 -- if we later call t1, this will help us. 
local t2 -- if we later call t2, this will help us. 
  
addEventHandler("onResourceStart", -- we add event for initiate function, on resource start. 
function() -- we start the function. 
t1 = createTeam("Team1", 255,0,0) --we create t1. 
setTeamFriendlyFire(t1, false) -- we set no friendly fire for t1. 
  
t2 = createTeam("Team2", 255,0,0) --we create t2. 
setTeamFriendlyFire(t1, false)-- we set no friendly fire for t2. 
  
end -- we close function. 
) -- we close event. 
  

Posted
  
addEventHandler("onResourceStart",resourceRoot, -- we add event for initiate function, on resource start. 
function() -- we start the function. 
t1 = createTeam("Team1", 255,0,0) --we create t1. 
setTeamFriendlyFire(getTeamFromName("Team1"), false) -- we set no friendly fire for t1. 
  
t2 = createTeam("Team2", 255,0,0) --we create t2. 
setTeamFriendlyFire(getTeamFromName("Team2"), false)-- we set no friendly fire for t2. 
  
end -- we close function. 
) -- we close event. 
  

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i try to make that

see

function createTeamsOnStart ()

teameJraM = createTeam ( "eJraM", 255, 0, 0 )

setTeamFriendlyFire(eJraM, false)

teamMaFia = createTeam ( "MaFia", 0, 255, 0 )

setTeamFriendlyFire(MaFia, false)

end

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach

but the problem not solved

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted
function createTeamsOnStart () 
teameJraM = createTeam ( "eJraM", 255, 0, 0 ) 
t1 = getTeamFromName("eJraM") 
setTeamFriendlyFire(t1, false) 
teamMaFia = createTeam ( "MaFia", 0, 255, 0 ) 
t2 = getTeamFromName("MaFia") 
setTeamFriendlyFire(t2, false) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach 
  

Posted

MOJRM-511, your code looks fine.

However, createTeam returns a team element if it was successfully created, false if invalid arguments are passed or a team with that name already exists.

MAKE SURE the team is NOT already created by some other resource or whatever.

If this is not the case, then maybe meta.xml is wrong?

Posted
MOJRM-511, your code looks fine.

However, createTeam returns a team element if it was successfully created, false if invalid arguments are passed or a team with that name already exists.

MAKE SURE the team is NOT already created by some other resource or whatever.

If this is not the case, then maybe meta.xml is wrong?

No, you need to use getTeamFromName

Posted
MOJRM-511, your code looks fine.

However, createTeam returns a team element if it was successfully created, false if invalid arguments are passed or a team with that name already exists.

MAKE SURE the team is NOT already created by some other resource or whatever.

If this is not the case, then maybe meta.xml is wrong?

No, you need to use getTeamFromName

I know the problem has been solved, but I'd like to clarify that you don't need to use getTeamFromName. createTeam returns an element which can be used for all functions just fine.

(Tested)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...