08-16-2009, 08:07 PM | #1 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
Lua ffix
Some time ago squeek did this for me for a mitair dm map (ff_psyz), but now im redoing it, and i want to fix the lua also.
So basicly the only problem i have with is that it doesnt counts with suicides. I want it to score with a frag , and remove a point with a suicide : ) end function player_onkill( player ) -- Test, Don't let blue team suicide. -- if player:GetTeamId() == Team.kBlue then -- return false -- end return true end -- Get team points for killing a player function player_killed( player_entity, damageinfo ) -- suicides have no damageinfo if damageinfo ~= nil then local killer = damageinfo:GetAttacker() local player = CastToPlayer( player_entity ) if IsPlayer(killer) then killer = CastToPlayer(killer) --local victim = GetPlayer(player_id) if not (player:GetTeamId() == killer:GetTeamId()) then local killersTeam = killer:GetTeam() killersTeam:AddScore(1) end end end end |
|
08-18-2009, 03:57 PM | #2 |
Lua Team
Join Date: Mar 2007
Posts Rated Helpful 1 Times
|
Haven't tested, but I think you want something like this:
Code:
-- Get team points for killing a player function player_killed( player_entity, damageinfo ) local player = CastToPlayer( player_entity ) -- suicides have no damageinfo if damageinfo ~= nil then local killer = damageinfo:GetAttacker() if IsPlayer(killer) then killer = CastToPlayer(killer) if not (player:GetTeamId() == killer:GetTeamId()) then local killersTeam = killer:GetTeam() killersTeam:AddScore(1) end end else -- must be a suicide as damageinfo == nil local playerTeam = player:GetTeam() playerTeam:AddScore(-1) end end |
|
08-18-2009, 11:16 PM | #3 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
ty : D
but i suicide my self 3 times, and in the top screen score still is as 0 : \ Last edited by zE; 08-18-2009 at 11:29 PM. |
|
08-19-2009, 12:09 AM | #4 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
I'm not sure you can add negative score to teams. And I'm not sure that team scores can go below 0.
__________________
#FF.Pickup ยค Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington |
|
08-28-2009, 01:56 AM | #5 |
Pew pew ze beams
Join Date: Jan 2008
Gametype: Gathers Affiliations: pew pew Posts Rated Helpful 11 Times
|
k np then : ) can someone do me a basic lua where u have red and blue team with soldier demo and medic classes avaible, and yellow team named spectator with only civilian class avaible, and no grenades.
when i try to tweak my previous lua, and just erase the score part from it, respaw spots go crazy, i respaw in the wrong places :\ |
|
09-14-2009, 05:35 PM | #6 |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|