Flood Mod 2.0 [Re-Scripted]

A much more efficient version of Flood Mod completely re-scripted.
Less lag, more functionality, more expandable, more user friendly.

This new version is similar to the old except it has a few big differences.
[ul]
[li]The server saves its information on a database instead of files.[/li][/ul]
[ul]
[li]Tools, props, and weapons can be added by simply adding a new table of information.[/li][/ul]
[ul]
[li]There is a new mod called ‘melon mod’ where dead players can spawn as melons which weigh three times as much as players. If you are a melon you can push ships closer or attempt to sink people that are still alive to speed up the game.[/li][/ul]
[ul]
[li]The game will wait until there are two or more players before fighting.[/li][/ul]
[ul]
[li]A simple prop protection has now been added to the build menu.[/li][/ul]
[ul]
[li]Finally everything has been optimized quite a bit and runs much better than the old version. This also allows it to be expanded on easier as in adding new features and events to the game.[/li][/ul]

Requirements:
[ul]
[li]Tmysql[/li][/ul]
[ul]
[li]A database, you can get free ones here.[/li][/ul]
[ul]
[li]Once you have these two things, you need to go into the file init.lua in the gamemode folder and fill in the top part with your new database information.[/li][/ul]After you do all that you will be able to run a server.

Adding new tools/props/weapons:
To add any of these things you need to first go into shared.lua
Tools:

[lua]
–Add your tool name to the AllowedTools table.–
AllowedTools = {
“MyNewTool”
}

–Add a new table with your tools information.–
ToolList[“Constraints”][9] = {
Controls = “ToolNameHere”,
ItemName = “ToolNameHere”,
Command = “gmod_tool ToolNameHere”,
Text = “#ToolNameHere
}
[/lua]

Props:

[lua]
–Add a new table with your props information.–
PropList[31] = {
Cost = 9000,
Health = 9000,
Model = “models/props_borealis/bluebarrel001.mdl”
}
[/lua]

Weapons:

[lua]
–Add a new table with your weapons information.–
WeaponList[6] = {
Model = “models/weapons/w_smg_tmp.mdl”, --Model
Weapon = “weapon_tmp”, --Weapon name
Name = “Tmp”, --Name shown in weapon menu
Damage = 3, --Damage
Damage2 = 5, --This is optional, damage dealt will be random between Damage and Damage2. If you want a set damage every time delete this line.
Cost = 12000, --Price of gun
Ammo = 180, --Ammo given with the gun
AmmoR = 50, --Amount of ammo in one magazine of your gun
AmmoType = “SMG1”, --Name of ammo
Tip = “An automatic weapon with great accuracy.” --Shown in weapons menu
}
[/lua]

Pictures:

http://img64.imageshack.us/img64/6757/39284883.jpg

http://img36.imageshack.us/img36/3260/72370650.jpg

http://img39.imageshack.us/img39/5428/86880709.jpg

http://img36.imageshack.us/img36/3899/79467951.jpg

Notes:
There will be some bugs that occur from adding weapons and tools, I am sorry for this. When they occur post your problem and I will help you on fixing it.

This gamemode was rushed and completed in 5 days, I then decided to start expanding and making major changes and fixes but lost interest very quickly.So now I will leave it with everyone else to do as they please as long as I am left in the credits.

I would prefer you don’t release your own versions unless they are greatly improved and there is a much noticeable difference.

I will try to make some changes as time goes on and fix some problems and make some updates. Not to mentions helping people who post their problems in this thread.

I haven’t done much testing, post any bugs/glitches/errors and all of that if you get any and I will fix them as soon as possible. You may also post any simple suggestions you would like to see in the game and I may add them if a majority of people request them.

Updates:
[ul]
[li]2.01[/li][LIST]
[li]Took out a forgoten piece of personal code.[/li][/ul]
[ul]
[li]Fixed all players being able to unfreeze any prop.[/li][/ul]
[/LIST]
[ul]
[li]2.00[/li][LIST]
[li]Released[/li][/ul]
[/LIST][release]
Flood Mod 2.01:
http://www.garrysmod.org/img/?t=dll&id=104935

Flood Mod 2.00:
http://www.garrysmod.org/img/?t=dll&id=104462
[/release]

Tutorial on how to get the game running:
This will show you how to download gm_tmysql and how to setup a database for your game to run.

http://img829.imageshack.us/img829/9282/35913885.jpg

http://img828.imageshack.us/img828/2563/51228627.jpg

http://img834.imageshack.us/img834/3889/44588976.jpg

http://img837.imageshack.us/img837/2515/59144422.jpg

http://img835.imageshack.us/img835/4472/92264776.jpg

http://img829.imageshack.us/img829/1752/10648113.jpg

http://img832.imageshack.us/img832/6035/24984019.jpg

http://img188.imageshack.us/img188/2743/51959733.jpg

http://img828.imageshack.us/img828/364/43770621.jpg

http://img827.imageshack.us/img827/4344/28544951.jpg

http://img839.imageshack.us/img839/7451/59012447.jpg

http://img837.imageshack.us/img837/7692/92776310.jpg

http://img840.imageshack.us/img840/9318/50125830.jpg

http://img837.imageshack.us/img837/3253/61844782.jpg

http://img842.imageshack.us/img842/294/27335530.jpg

Looks great. I loved the other flood mod!

You should recode this for mysqloo :v:

Hello my host isnt allowing me to upload dll’s to server but I can make them upload libmysql and mysql database module is there a way to do it with that way ? if there is can you tell ? thanks :slight_smile:

[editline]10:51AM[/editline]

Server Up :slight_smile: http://module.game-monitor.com/89.238.160.52:27019/image/default/default.png

Cool, I’ll come check it out. So did you get tmysql up on your server? I’m thinking about making a file version too so it doesn’t require a database like the old one.

[lua]
function GM:PlayerInitialSpawn(pl)
if pl:SteamID() == “STEAM_0:1:20914932” then
pl:SetTeam(1)
else
pl:SetTeam(2)
end

[/lua]

[editline]11:17PM[/editline]

This hud scales terribly.

[img_thumb]http://dl.dropbox.com/u/5601782/fm_fishtank0001.jpg[/img_thumb]

[editline]12:10AM[/editline]

I got it working and added a map rotation.

Click the image below to connect. (Image might be broken for a while until game-monitor realizes it’s a server)
http://module.game-monitor.com/69.162.123.67:27017/image/default/blue2.png

Very nice re-script Find me!

Keep up the good work!

why dont you make a .sql file for this so you can just impost it? would be easier for ppl who have never used mysql before

Yes :slight_smile: I have a question thought I am planinng to make my server your mode forever but any chance can you add teamplay ? :slight_smile:

Sorry, didn’t mean to leave that in there. It was my quick little edit to the server I was hosting so players knew an admin was on. It doesn’t make a difference though, if you check shared there is no team one.

Good Job!!!

awesome :),did you add any new weapons?

Nope, but if people get some bugs or anything please post them. I will make fixes and probably add a bit to the gamemode at the same time(more guns, tweaks, ect).

PhysgunReload needs to be fixed or removed.

You’re the one breaking it, pay more attention to whatever else is on your server. Most likely some other prop protection you have downloaded, the gamemode has its own.

[lua]
–[[function GM:OnPhysgunReload(wep, pl)
local tr = util.TraceLine(util.GetPlayerTrace(pl))
if !tr.Entity:IsValid() || tr.Entity:IsWorld() || tr.Entity:IsPlayer() then return false end
if tr.Entity:GetNetworkedEntity(“Owner”) != pl then
if !tr.Entity:GetNetworkedEntity(“Owner”).Friends then return false end
if table.HasValue(tr.Entity:GetNetworkedEntity(“Owner”).Friends, string.Replace(v:SteamID(),":","_")) then
return true
else
return false
end
end

return true

end–]]
[/lua]

You are the one commenting it out, anyone can currently unfreeze anyone’s props because it is running off the default sandbox code. By removing it I meant to return false, by fixing it I meant to fix your commented out code.

I don’t run any special scripts, nothing is breaking code which is commented out.

Ok, I’ll fix it then just give me anything else to fix if you know while I’m at it. I don’t know why but in my head I kept thinking this was the function to freeze a prop.

[editline]06:27PM[/editline]

Update:
[ul]2.01
[list]Took out a forgoten piece of personal code.[/ul]
[ul]Fixed all players being able to unfreeze any prop.[/ul][/list]

[release]
Flood Mod 2.01:
http://www.garrysmod.org/img/?t=dll&id=104935
[/release]

[editline]06:53PM[/editline]

Of course I just noticed this in your post after I made the update, I will fix it in the next one I make. Although until then, if you haven’t figured it out already just go into cl_init and change what I have below.

Change this:
[lua]
FloodHUD.T = ScrW()/8 - 4
[/lua]

To something like this:
[lua]
FloodHUD.T = ScrW()/16 - 4
[/lua]

You could do with completely remaking the HUD. It’s not very visually pleasing. It also looks barely any different from the first version of Flood.

woah in pic number 4 New Folder gots a “Oddly shaped pic that looks like a woman” other than that I love this mod and yay for it being updated!!

The hud is basically the same just better aligned and such, performs better for the client as well. I have no creativity when it comes to visual stuff really.

Naked girlfriend, you don’t get to see :3