if (WantConfig) then
return {
name = 'thief_control', -- the only required field
desc = 'Thief Control (based on Enigma\'s C++ plugin)',
author = 'trepan',
date = 'Jul 25, 2009',
license = 'LGPL 2.1',
niceness = 0,
}
end
local teamFlags = { ['R*'] = 1, ['G*'] = 2, ['B*'] = 3, ['P*'] = 4 }
function CallIn.FlagTransfer(srcID, dstID, flagType)
local gameType = bz.GetGameType()
local srcTeam, dstTeam = bz.GetPlayerTeam(srcID), bz.GetPlayerTeam(dstID)
if ((srcTeam ~= dstTeam) or
(dstTeam == BZ.TEAM.ROGUE) or
(gameType == BZ.GAME.OPEN) or
((gameType == BZ.GAME.CTF) and teamFlags[flagType])) then
return -- carry on, nothing to see here
end
bz.SendMessage(BZ.PLAYER.SERVER, dstID, dropMsg,
"Flag dropped. Don't steal from teammates!")
return 'drop'
end
The server-side lua support was added back, client-side lua is still out.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
Hm... looks like I am learning Lua. I just installed lua, so I can follow the tutorials and learn the language before moving to bzfs plug-ins. From what I've seen so far, I think I'm going to like this language.
In an excerpt from the book Programming in Lua, I feel like they had C++ in mind when they wrote this paragraph: "Currently, many programming languages are concerned with how to help you write programs with hundreds of thousands of lines. For that, they offer you packages, namespaces, complex type systems, a myriad of constructions, and thousands of documentation pages to be studied."
I am actually looking forward to the client-side plug-ins more than the server-side plug-ins, as I don't run a server: I can't really use the code I write.
I should also mention that I wasn't the first person to write the ThiefControl plug-in. I added different behaviors for each game type. The original one simply blocked thief steals for players on the same team, regardless of the game type.
Enigma wrote:I am actually looking forward to the client-side plug-ins more than the server-side plug-ins, as I don't run a server: I can't really use the code I write.
Client-side plugins were removed.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)
Enigma wrote:I am actually looking forward to the client-side plug-ins more than the server-side plug-ins, as I don't run a server: I can't really use the code I write.
Client-side plugins were removed.
Oh I know. It was my understanding that they might be added at a later date.