Jump to content

Team Weapon help


Recommended Posts

Okay, so I would like to give M4 to each person from the "Red" team, and to every player from the "Blue" team I would like to give Ak47, How can I do it?

 

-- server side

red = createTeam("Red team", 255, 0, 0)
blue = createTeam("Blue team", 0, 255, 0)

giveWeapon("red team????", 31, 9999)
giveWeapon("blue team????", 30, 9999)

 

Something like this is on my mind but I do not know what to put in the "string" red team and blue team...

Link to comment

Server Side

function onPlayerSpawn()
	if isElement(source) then -- Source here is the player
		if getTeamName(getPlayerTeam(source)) == "Red Team" then -- Team Name
			giveWeapon(source, 31, 500, true) -- Weapon
		elseif getTeamName(getPlayerTeam(source)) == "Blue Team" then -- Team Name
			giveWeapon(source, 30, 500, true) -- Weapon
		end
	end
end
addEventHandler("onPlayerSpawn", root, onPlayerSpawn)

 

Link to comment

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...