Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2024, 05:02:26 AM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Higher Karma Start for donators
Pages: [1]
Author Topic: Higher Karma Start for donators  (Read 3958 times)
hayhay89
Poster

Posts: 100


« on: December 04, 2010, 11:34:47 AM »

As the title says i need some to help me code something will allow
donators to start with more karma.

im using Ulx So yeh go crazy

thanks in advance to anyone who can help me.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #1 on: December 04, 2010, 08:20:52 PM »

According to BKU, this was/is impossible when i asked him, but you'd have to edit the gamemode.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #2 on: December 04, 2010, 11:00:17 PM »

this should give 100 extra karma on every round


function KARMA.RoundIncrement()
  local healbonus = config.roundheal:GetFloat()
  local cleanbonus = config.clean:GetFloat()

  for _, ply in pairs(player.GetAll()) do
     local bonus = healbonus + (ply:GetCleanRound() and cleanbonus or 0)      
     KARMA.GiveReward(ply, bonus)
 if ply:IsUserGroup("Donator") then
KARMA.GiveReward(ply, 100)
 end

     if IsDebug() then
        print(ply, "gets roundincr", incr)
     end
  end

  -- player's CleanRound state will be reset by the ply class
end


This goes into karma.lua and over-rights the current function.
« Last Edit: December 04, 2010, 11:01:39 PM by Manmax75 »

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
hayhay89
Poster

Posts: 100


« Reply #3 on: December 05, 2010, 02:17:18 AM »

Hey guys i got my friend to code this up So if you wanna add it to your server feel free.


Quote
function KARMA.InitPlayer(ply)
  local k = KARMA.Recall(ply) or config.starting:GetFloat()

  k = math.Clamp(k, 0, config.max:GetFloat())


  -- Set karma below here!
  local donatKarma = 1000
  -- Set karma above here! --

  if ply:GetUserGroup() == "donators" then
     ply:SetBaseKarma(donatKarma)
     ply:SetLiveKarma(donatKarma)
  else                       -- everyone else
     ply:SetBaseKarma(k)
     ply:SetLiveKarma(k)
  end

  ply:SetCleanRound(true)
  ply:SetDamageFactor(1.0)

  -- compute the damagefactor based on actual (possibly loaded) karma
  KARMA.ApplyKarma(ply)
end
« Last Edit: December 05, 2010, 04:04:21 PM by hayhay89 »
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #4 on: December 05, 2010, 03:34:31 AM »

then try mine?

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #5 on: December 05, 2010, 01:28:49 PM »

this should give 100 extra karma on every round


function KARMA.RoundIncrement()
  local healbonus = config.roundheal:GetFloat()
  local cleanbonus = config.clean:GetFloat()

  for _, ply in pairs(player.GetAll()) do
      local bonus = healbonus + (ply:GetCleanRound() and cleanbonus or 0)     
      KARMA.GiveReward(ply, bonus)
  if ply:IsUserGroup("Donator") then
KARMA.GiveReward(ply, 100)
  end

      if IsDebug() then
        print(ply, "gets roundincr", incr)
      end
  end

  -- player's CleanRound state will be reset by the ply class
end


This goes into karma.lua and over-rights the current function.


He wanted them to start with more. Not become RDM gods not affected by Karma each round.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
hayhay89
Poster

Posts: 100


« Reply #6 on: December 05, 2010, 04:05:01 PM »

Turns out it wasnt the code it was me being a dur dur when i placed it.

it works perfectly.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Higher Karma Start for donators « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 17 queries.