• TTT pointshop points?
    16 replies, posted
is there a script that gets you points by: being full karma, killing Ts, killing innos as T if so plz link or paste below
[code]--Not my code, thanks to Brandonj4 --To be placed in lua/autorun/server/ -- ROLE_INNOCENT = 0 -- ROLE_TRAITOR = 1 -- ROLE_DETECTIVE = 2 -- ROLE_NONE = ROLE_INNOCENT local RolePoints = { [2] = {[2] = -30,--Killed Detective as Detective [0] = -10,--Killed Innocent as Detective [1] = 20--Killed Traitor as Detective }, [0] = {[2] = -50,--Killed Detective as Innocent [0] = -20,--Killed Innocent as Innocent [1] = 20--Killed Traitor as Innocent }, [1] = {[2] = 50,--Killed Detective as Traitor [0] = 25,--Killed Innocent as Traitor [1] = -30--Killed Traitor as Traitor } } function NotifyPlayer(ply, killer) local num = RolePoints[killer:GetRole()][ply:GetRole()] local bool = string.find(num, "-") ply:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were killed by "..killer:Nick().." they were "..killer:GetRoleString()..".") if bool then killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") else killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") end killer:PS_GivePoints(num) end function PointShopDeathHook(ply, killer, dmginfo) if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() or ply == killer then return end if GetRoundState() == ROUND_ACTIVE then NotifyPlayer(ply, killer) end end hook.Add("DoPlayerDeath", "PointShopDeathHook", PointShopDeathHook)[/code]
where does this go ? and TY [editline]12th January 2014[/editline] addons\[pointshop]\lua\autorun ?
[QUOTE=michaelevil;43504010]where does this go ? and TY [editline]12th January 2014[/editline] addons\[pointshop]\lua\autorun ?[/QUOTE] Read the top of the code..it says --To be placed in lua/autorun/server/
o *facepalm* ok TY
Here's the one for karma. [code]local numpoints = 10 hook.Add( "TTTBeginRound", "karma_reward", function() for k,v in pairs( player.GetAll() ) do timer.Simple( 3, function() if v:GetBaseKarma() == 1000 then v:PS_GivePoints(numpoints) end end) end end[/code]
now that ive got you here how would i change my TTT starting weapons ?
SWEP.InLoadoutFor. For example, in terrortown/entities/weapons/weapon_zm_improvised/shared.lua, on line 40, [code]SWEP.InLoadoutFor = {ROLE_INNOCENT, ROLE_TRAITOR, ROLE_DETECTIVE}[/code] Just add that to any SWEP you want people to have.
Karma points ERROR ?? [CODE][ERROR] lua/autorun/server/tttkarmapoints.lua:11: '>' expected <to close '<' at line 3> near '<eof>' 1. unknown - lua/autorun/server/tttkarmapoints.lua:0[/CODE]
Oops, add a ) after the last end on line 11.
[QUOTE=code_gs;43504207]Oops, add a ) after the last end on line 11.[/QUOTE] Hey code check my other post while you can.
YEA !!!! TY [editline]12th January 2014[/editline] o and im srry about the double post i just thought no one was looking at that.
I have a question to brandonj's Script about the money gained on killing traitors etc. If i kill my self with c4 i get -points for killing a traitor! thats very confusing because i get 2 messages one is saying i killed my self and another says i killed deinemudda32 -500 Points! Dafuq...
I'll fix that tonight.
[code]--Not my code, thanks to Brandonj4 --To be placed in lua/autorun/server/ -- ROLE_INNOCENT = 0 -- ROLE_TRAITOR = 1 -- ROLE_DETECTIVE = 2 -- ROLE_NONE = ROLE_INNOCENT local RolePoints = { [2] = {[2] = -30,--Killed Detective as Detective [0] = -10,--Killed Innocent as Detective [1] = 20--Killed Traitor as Detective }, [0] = {[2] = -50,--Killed Detective as Innocent [0] = -20,--Killed Innocent as Innocent [1] = 20--Killed Traitor as Innocent }, [1] = {[2] = 50,--Killed Detective as Traitor [0] = 25,--Killed Innocent as Traitor [1] = -30--Killed Traitor as Traitor } } function NotifyPlayer(ply, killer) local num = RolePoints[killer:GetRole()][ply:GetRole()] local bool = string.find(num, "-") ply:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were killed by "..killer:Nick().." they were "..killer:GetRoleString()..".") if bool then killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You had "..num.." points taken away for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") else killer:PrintMessage(HUD_PRINTTALK, "[TTT] Shop: You were awarded "..num.." points for killing "..ply:Nick()..", they were a(n) "..ply:GetRoleString()..".") end killer:PS_GivePoints(num) end function PointShopDeathHook(ply, killer, dmginfo) if !IsValid(killer) or !killer:IsPlayer() or !IsValid(ply) or !ply:IsPlayer() or (ply == killer) then return end if GetRoundState() == ROUND_ACTIVE then NotifyPlayer(ply, killer) end end hook.Add("DoPlayerDeath", "PointShopDeathHook", PointShopDeathHook)[/code] Here you go, just made a stupid mistake.
Hello, I see that you read and understand the source code of the pointshop configs. Maybe you can help me. I would like to have some points more. I would like to have points for: - Your Team won the round. - You are alive. - You have 100% life AND kill minimum one enemy. Thanks a lot.
[QUOTE=Mr D Teach;50003890]Hello, I see that you read and understand the source code of the pointshop configs. Maybe you can help me. I would like to have some points more. I would like to have points for: - Your Team won the round. - You are alive. - You have 100% life AND kill minimum one enemy. Thanks a lot.[/QUOTE] You really should have made a new thread, this one is over 2 years old
Sorry, you need to Log In to post a reply to this thread.