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. |
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
|
Code:
-- Assuming this overrides the base_flag functions. |
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 |
Quote:
|
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 |
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. |
The flag probably has no allowed() function. You probably have to override baseflag's touch function. Try this:
Code:
function baseflag:touch( touch_entity ) |
Thanks, that worked
|
So im kinda interested on this to my server, but what to edit base_ctf lua ? and can someone post full workinfg lua plz : D
|
This is what I ended up using, and I put it into my base_ctf.lua
The number 10 near the top is what you change to suit your needs for your server, say if you want a full game to be enabled at 18 players you'd change it to 18 Code:
function GetNumAllPlayers() return GetTeam(Team.kRed):GetNumPlayers() + GetTeam(Team.kBlue):GetNumPlayers() end |
yo bri is it possible with this lua limit certain classes, when theres <= 10 players and display message when theres 11 players to warn that blue flag is avaible D: that would be leet
|
All times are GMT. The time now is 03:22 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.