Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 12-14-2007, 01:31 AM   #1
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
what iam i doing wrong?

--ff_blah.lua
-----------------------------------------------------------------------------
function startup()
--Blueteam
local team = GetTeam( Team.kBlue )
SetPlayerLimit( Team.kBlue, 2 )
team:SetClassLimit( Player.kCivilian, -1 )

--Redteam
team = GetTeam( Team.kRed )
SetPlayerLimit( Team.kRed, 0 )
team:SetClassLimit( Player.kScout, 0 )
team:SetClassLimit( Player.kSniper, -1 )
team:SetClassLimit( Player.kSoldier, -1 )
team:SetClassLimit( Player.kDemoman, -1 )
team:SetClassLimit( Player.kMedic, -1 )
team:SetClassLimit( Player.kHwguy, -1 )
team:SetClassLimit( Player.kPyro, -1 )
team:SetClassLimit( Player.kSpy, -1 )
team:SetClassLimit( Player.kEngineer, -1 )
team:SetClassLimit( Player.kCivilian, -1 )

--yellowteam
team = GetTeam( Team.kyellow )
SetPlayerLimit( Team.kyellow, 2 )
team:SetClassLimit( Player.kCivilian, -1 )

--greenteam
team = GetTeam( Team.kGreen )
team:SetPlayerLimit( -1 )
end
some-guy is offline   Reply With Quote


Old 12-14-2007, 03:48 AM   #2
Ihmhi
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff
 
Ihmhi's Avatar
 
Join Date: Mar 2007
Location: Newark, NJ, United States
Class/Position: A little bit o' everythin'
Gametype: Also a little bit o' everythin'
Affiliations: [AE] Asseater, *SJB Straight Jacket Brigade
Posts Rated Helpful 3 Times
Send a message via AIM to Ihmhi Send a message via MSN to Ihmhi Send a message via Yahoo to Ihmhi
Please clearly state to us what the problem you are having is. Asking "What am I doing wrong?" and posting a bunch of Lua code is not going to get you much help.

What is wrong with the code? Does it not work when you load your map? Are the teams not working properly?

Please be more detailed.
__________________
Support FF:
Anime: The Thread: Reloaded
The one and only anime thread on these here forums.

Select the pistol, and then, select your horse.
Ihmhi is offline   Reply With Quote


Old 12-14-2007, 03:51 AM   #3
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
I think the Player Limits aren't working?
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline   Reply With Quote


Old 12-14-2007, 06:43 AM   #4
4est
Fortress Forever Staff
 
4est's Avatar
 
Join Date: Mar 2007
Location: OK
Posts Rated Helpful 0 Times
Send a message via Yahoo to 4est
Are you the same someguy who made me crosshairs years ago?
__________________
Welcome to ZOMBOCOM!
Support FF:
4est is offline   Reply With Quote


Old 12-14-2007, 06:56 AM   #5
Jester
Fortress Forever Staff
 
Jester's Avatar
 
Join Date: Sep 2007
Class/Position: O: Scout
Affiliations: {NFO} - New Family Order
Posts Rated Helpful 0 Times
Should the kyellow's be kYellow's?
Jester is offline   Reply With Quote


Old 12-15-2007, 12:05 AM   #6
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
sorry when i load the map the lua dont work i wanted to get 3 teams

blue team with only 2 players on the team and can be any class but civians

red team with any amount of players and can only be civlians

yellow team with only 2 players and can be any class but civians
some-guy is offline   Reply With Quote


Old 12-15-2007, 12:17 AM   #7
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
Quote:
Originally Posted by Jester
Should the kyellow's be kYellow's?
Yep, code syntax is almost always case sensitive, which means that if the syntax wants a capital letter, it must be capital letter, and if it wants a normal letter it should be normal letter.

If you want red to be only civilians, why have you restricted them from being any class but scout?

Anyway, here's what you need:
Code:
function startup()
	-- Set up team limits on each team
	SetPlayerLimit(Team.kBlue, 2)
	SetPlayerLimit(Team.kRed, 0)
	SetPlayerLimit(Team.kYellow, 2)
	SetPlayerLimit(Team.kGreen, -1)

	local team = GetTeam( Team.kBlue )
	team:SetClassLimit( Player.kCivilian, -1 ) 

	local team = GetTeam( Team.kRed )
	team:SetClassLimit( Player.kScout, -1 )
	team:SetClassLimit( Player.kSniper, -1 )
	team:SetClassLimit( Player.kSoldier, -1 )
	team:SetClassLimit( Player.kDemoman, -1 )
	team:SetClassLimit( Player.kMedic, -1 )
	team:SetClassLimit( Player.kHwguy, -1 )
	team:SetClassLimit( Player.kPyro, -1 )
	team:SetClassLimit( Player.kSpy, -1 )
	team:SetClassLimit( Player.kEngineer, -1 )
	team:SetClassLimit( Player.kCivilian, 0 )
	
	local team = GetTeam( Team.kYellow )
	team:SetClassLimit( Player.kCivilian, -1 )
	
end
A1win is offline   Reply With Quote


Old 12-15-2007, 12:25 AM   #8
some-guy
 
Join Date: Dec 2007
Posts Rated Helpful 0 Times
thanks man
some-guy is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.