09-20-2010, 09:28 AM | #1 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
Quad Lua
Hi so im using base_quad lua but i need something diferent something like:
Blue team -> (Normal no quad) classes - Medic and Scout Red team -> (Quad on) classes - Scout, Medic, soldier, Demo, Pyro, Engeneer Green team -> Same as red Yellow team -> (Normal no quad) classes - civilian only. If anyone can help i apreciate D: Last edited by zE; 09-20-2010 at 09:28 AM. |
|
09-20-2010, 08:38 PM | #2 |
internet user
Fortress Forever Staff
Join Date: Jun 2007
Posts Rated Helpful 42 Times
|
Have you tried it yet and are having issues?
Or you want someone to do the team & class layout for you |
|
09-20-2010, 08:48 PM | #3 |
internet user
Fortress Forever Staff
Join Date: Jun 2007
Posts Rated Helpful 42 Times
|
This will do the team stuff for u
Code:
IncludeScript("base_quad"); function startup() SetTeamName( Team.kBlue, "Normal no quad" ) SetTeamName( Team.kRed, "Quad on" ) SetTeamName( Team.kGreen, "Quad on 2" ) SetTeamName( Team.kYellow, "Civilian only" ) SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, 0) SetPlayerLimit(Team.kGreen, 0) local team = GetTeam( Team.kBlue ) team:SetClassLimit( Player.kScout, 0 ) team:SetClassLimit( Player.kMedic, 0 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team:SetClassLimit( Player.kSniper, -1 ) team:SetClassLimit( Player.kSoldier, -1 ) team:SetClassLimit( Player.kDemoman, -1 ) team:SetClassLimit( Player.kPyro, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) local team = GetTeam( Team.kRed ) team:SetClassLimit( Player.kScout, 0 ) team:SetClassLimit( Player.kMedic, 0 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kEngineer, 0 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team:SetClassLimit( Player.kSniper, -1 ) local team = GetTeam( Team.kGreen ) team:SetClassLimit( Player.kScout, 0 ) team:SetClassLimit( Player.kMedic, 0 ) team:SetClassLimit( Player.kSoldier, 0 ) team:SetClassLimit( Player.kDemoman, 0 ) team:SetClassLimit( Player.kPyro, 0 ) team:SetClassLimit( Player.kEngineer, 0 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kCivilian, -1 ) team:SetClassLimit( Player.kSniper, -1 ) local team = GetTeam( Team.kYellow ) team:SetClassLimit( Player.kCivilian, 0 ) team:SetClassLimit( Player.kScout, -1 ) team:SetClassLimit( Player.kMedic, -1) team:SetClassLimit( Player.kSoldier, -1 ) team:SetClassLimit( Player.kDemoman, -1 ) team:SetClassLimit( Player.kPyro, -1 ) team:SetClassLimit( Player.kEngineer, -1 ) team:SetClassLimit( Player.kHwguy, -1 ) team:SetClassLimit( Player.kSpy, -1 ) team:SetClassLimit( Player.kSniper, -1 ) end |
|
09-20-2010, 10:45 PM | #4 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
Thks Dexter , but what i needed was something diferent, the default quad_lua allows only quad on red team and only soldier demoman and pyro classes, and i needed to add a green team to quad and also include engeneer as quad. But thks anyway.
Bri helped me with it and it goes like this: -- base_quad.lua ---------------------------------------------------------------------- -- Quad icon ---------------------------------------------------------------------- hudicon = "hud_quad" hudx = 5 hudy = 110 hudw = 48 hudh = 48 huda = 1 hudstatusicon = "hud_quad.vtf" ---------------------------------------------------------------------- -- Set hud icon at spawn ---------------------------------------------------------------------- function player_spawn( player_entity ) local player = CastToPlayer( player_entity ) local class = player:GetClass() if class == Player.kSoldier or class == Player.kDemoman or class == Player.kMedic or class == Player.kEngineer or class == Player.kPyro then if player:GetTeamId() ~= Team.kRed then RemoveHudItem( player, hudstatusicon ) else AddHudIcon(player, hudicon, hudstatusicon, hudx, hudy, hudw, hudh, huda) end else RemoveHudItem( player, hudstatusicon ) end end ---------------------------------------------------------------------- -- Remove hud icon if player changes to spectator ---------------------------------------------------------------------- function player_switchteam( player, currentteam, desiredteam ) if desiredteam == Team.kSpectator then RemoveHudItem( player, hudstatusicon ) end return true end ---------------------------------------------------------------------- -- Set quad and invul when damage is taken by soldier and demoman and pyro ---------------------------------------------------------------------- function player_ondamage(player, damageinfo) if player:GetTeamId() == Team.kRed or player:GetTeamId() == Team.kGreen then local damage_force = damageinfo:GetDamageForce() damageinfo:SetDamageForce(Vector(damage_force.x*4, damage_force.y*4, damage_force.z*4)) damageinfo:SetDamage(0) end end Last edited by zE; 09-20-2010 at 10:47 PM. |
|
09-20-2010, 11:39 PM | #5 |
internet user
Fortress Forever Staff
Join Date: Jun 2007
Posts Rated Helpful 42 Times
|
Oh ok oops!
|
|
09-29-2010, 06:33 AM | #6 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
So basicly im still working on this lua, that bridget and squeek basicly did all , but im kinda bored of boring always the same dudes to help me with this, so if anyone knows plz help : D
The last lua crashed the server, so I had with help redo the last part. PHP Code:
That code like that makes the quad do damage, and I dont want damage : <, im sure its that part of code of it that does it because I tested it with it and wihout it : D Last edited by zE; 09-29-2010 at 06:45 AM. |
|
09-29-2010, 10:20 AM | #7 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Code:
----------------------------------------------------------------------- ----------Lua by Bridget and Squeek ----------------------------------------------------------------------- ---HUD icons and Quad Power settings = { red_vtf = "quad.vtf", red_quad = 4, blue_vtf = "blue.vtf", blue_quad = 1, green_vtf = "easy.vtf", green_quad = 4, yellow_vtf = "double.vtf", yellow_quad = 2 } function returnInformation(team) i = {vtf="",quad=0} if team == Team.kRed then i["vtf"]=settings["red_vtf"]; i["quad"]=settings["red_quad"] end if team == Team.kBlue then i["vtf"]=settings["blue_vtf"]; i["quad"]=settings["blue_quad"] end if team == Team.kGreen then i["vtf"]=settings["green_vtf"]; i["quad"]=settings["green_quad"] end if team == Team.kYellow then i["vtf"]=settings["yellow_vtf"]; i["quad"]=settings["yellow_quad"] end return i end ---Remove Grenades and stuff at spawn function player_spawn(player_entity) local player = CastToPlayer(player_entity) -- Ammo removal if player:GetClass() == Player.kDemoman then player:RemoveWeapon("ff_weapon_detpack") player:RemoveAmmo(Ammo.kGren2, 4) elseif player:GetClass() == Player.kPyro then player:RemoveAmmo(Ammo.kGren2, 4) elseif player:GetClass() == Player.kEngineer then player:RemoveAmmo(Ammo.kGren2, 4) elseif player:GetClass() == Player.kMedic then player:RemoveAmmo(Ammo.kGren1, 4) elseif player:GetClass() == Player.kScout then player:RemoveAmmo(Ammo.kManCannon, 1) end ---Remove HUD icon i = returnInformation(player:GetTeamId()) RemoveHudItem(player, "quad_icon"); if i["quad"] > 1 then AddHudIcon(player, i["vtf"], "quad_icon", 5, 119, 48, 48, 0) end return true end function player_switchteam(player, old, new) RemoveHudItem(player, "quad_icon"); return true end ---Quad and no damage except for trigger_hurt function player_ondamage( player, damageinfo ) -- if no damageinfo do nothing if not damageinfo then return end -- remove all fall damage if damageinfo:GetDamageType() == Damage.kFall then damageinfo:SetDamage(0) return end -- Entity that is attacking local attacker = damageinfo:GetAttacker() -- If no attacker do nothing if not attacker then return end local player_attacker = nil -- get the attacking player if IsPlayer(attacker) then attacker = CastToPlayer(attacker) player_attacker = attacker elseif IsSentrygun(attacker) then attacker = CastToSentrygun(attacker) player_attacker = attacker:GetOwner() elseif IsDetpack(attacker) then attacker = CastToDetpack(attacker) player_attacker = attacker:GetOwner() elseif IsDispenser(attacker) then attacker = CastToDispenser(attacker) player_attacker = attacker:GetOwner() else return end -- if still no attacking player after all that, forget about it if not player_attacker then return end -- If attacker is also the victim (self damage) if player:GetId() == player_attacker:GetId() then -- change push force local damage_force = damageinfo:GetDamageForce() i = returnInformation(player:GetTeamId()) damageinfo:SetDamageForce(Vector(damage_force.x*i["quad"], damage_force.y*i["quad"], damage_force.z*i["quad"])) -- set damage to zero damageinfo:SetDamage(0) return end -- for everyone else, use attackers quad force -- change push force local damage_force = damageinfo:GetDamageForce() i = returnInformation(player_attacker:GetTeamId()) damageinfo:SetDamageForce(Vector(damage_force.x*i["quad"], damage_force.y*i["quad"], damage_force.z*i["quad"])) -- set damage to zero damageinfo:SetDamage(0) if player:GetTeamId() == Team.kGreen then ApplyToPlayer(player, {AT.kReloadClips}) end end |
|
09-29-2010, 09:27 PM | #8 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
That last lua makes the auto reload in green doest work : \
|
|
09-30-2010, 09:58 PM | #9 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
Double post ftl
Last edited by zE; 09-30-2010 at 10:38 PM. |
|
09-30-2010, 10:38 PM | #10 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
Working now : D Bri fixed it ftw
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|