|
02-01-2011, 03:05 PM | #1 |
D&A Member
Join Date: Sep 2007
Posts Rated Helpful 13 Times
|
Slay on Flag touch
I'm looking for a lua that would make it so, until a certain number of players on the server is reached if the red team touched the blue flag they will be slain.
Once the server has like 10 people playing, the blue flag becomes available to touch again. If the player count drops below 10 anyone who touches the blue flag will again be slain. These are just arbitrary numbers but I imagine it would be simple enough to just modify the given number in the script. I would also like to send a message to the player's screen that was just slain by touching the flag. And a message to all players when the specified player count is reached, or fallen below Also since i'm not too familiar with lua's I was wondering if it's possible to set this up for all maps without edititing each individual lua file (like some sort of master lua file?), if not, it wouldn't be too tough to write a program that would inject it into every lua, so i'm not really too worried about this part. |
|
02-01-2011, 04:07 PM | #2 |
Gets tickled by FF
Fortress Forever Staff
Join Date: Jun 2007
Location: UK
Class/Position: Med Solly HW Gametype: Any/CTF Posts Rated Helpful 41 Times
|
or to disallow item pickup and just display the message. Don't like killing people for no reason. Alternatively prompt those that are offensive classes to change also. Nice idea
|
|
02-01-2011, 04:35 PM | #3 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Code:
-- Assuming this overrides the base_flag functions. -- Also assuming the blue flag is named 'blue flag'. -- Also assuming info_ff_script has an allowed() return function. function GetNumAllPlayers() return GetTeam(Team.kRed):GetNumPlayers() + GetTeam(Team.kBlue):GetNumPlayers() end function baseflag:allowed() if GetNumAllPlayers() >= 10 then return true else return false end function player_ondisconnect() -- Game still counts the player during this function's execution, I think? if (GetNumAllPlayers() - 1) < 10 then GetInfoScriptByName('blue flag'):Return() BroadCastMessage('The Blue Flag has returned due to player limit being under ten.') end end Last edited by Bridget; 02-01-2011 at 04:36 PM. Reason: forgot an end |
|
02-01-2011, 04:56 PM | #4 |
D&A Member
Join Date: Sep 2007
Posts Rated Helpful 13 Times
|
Ya elmo dissallowing flag touch with a message to the user would be fine too.
I'll have to test the script out later as I am at work atm, thanks bridget |
|
02-01-2011, 06:34 PM | #5 | |
D&A Member
Join Date: Sep 2007
Posts Rated Helpful 13 Times
|
Quote:
|
|
|
02-02-2011, 01:01 PM | #6 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Change
Code:
function baseflag:allowed() if GetNumAllPlayers() >= 10 then return true else return false end Code:
function baseflag:allowed() if GetNumAllPlayers() >= 10 then return true else return false end end |
|
02-02-2011, 06:31 PM | #7 |
D&A Member
Join Date: Sep 2007
Posts Rated Helpful 13 Times
|
Okay, no more errors, map starts fine, can select team and classes.
But I'm still capable of being able to touch the blue flag, so it's not quite accomplishing what's intended. As the only person in the server I should not be able to touch the blue flag until the player count reaches 10. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|