Achivement Award

I’m making a award for a achievement for DarkRP on a server i code for and i cannot figure out how to give the player money after completing the achievement.

Example.

local ACH = {}
ACH.Type = ACHIEVEMENT_PROGRESS
ACH.Description = “Kill 10 NPCs.”
ACH.Image = “gui/silkicons/bomb”
ACH.Target = 10
function ACH:OnKilledNPC( ply, npc )
self:AwardPoint( ply )
end
achievements.Register( “AI Killing”, “AI Owner”, ACH )

Where it says Award i need it to give the player $200

Any help would be great.

Thanks,
AnarchistX

do ply:AddMoney(200)

[editline]10:58AM[/editline]

that is the command to give the player money
not sure if it is what you needed or where you should place it
what achivements mod are you using?

Thanks ill try.

Is there a better mod?

seems to be the best and i think i found a way to do it but i’m not sure, give me a second

[editline]11:08AM[/editline]

try to add this:



function ACH:Earnt(ply)
		umsg.Start( "ach_earnt", ply )
			umsg.String( self.Name )
		umsg.End()
		PrintMessage( HUD_PRINTTALK, ply:Nick() .. " has earnt the achievement '" .. self.Name .. "'!" )
ply:AddMoney(200)
end


Add that to the bottom? seems to be a bit of code for one little thing.

add it at the bottom before achivement.Register

[editline]11:11AM[/editline]

normaly it would just be one line but that function is used in the base so the old code have to be there too everything except ply:AddMoney(200) is there so it wont fuck up the base

local total = achievements.GetValue( “PunchingBag”, “total”, 0 )
local function Killed( victim, inflictor )
local ply = LocalPlayer()
if ( !ValidEntity( ply ) ) then return end

if ( total != 5 && inflictor == "hl2_combo_fists" && victim == ply ) then
	total = math.Clamp( total + 1, 0, 5 )
	achievements.SetValue( "PunchingBag", "total", total )
	achievements.Update( "PunchingBag", total / 5, total .. "/5" )
	
end

end

local function PlayerKilled( msg )
local victim, inflictor, attacker = msg:ReadEntity(), msg:ReadString(), msg:ReadString()
Killed( victim, inflictor )
return victim, inflictor, attacker
end
usermessage.AddHook( “PlayerKilled”, “achievements.PunchingBag”, PlayerKilled )
local function PlayerKilledByPlayer( msg )
local victim, inflictor, attacker = msg:ReadEntity(), msg:ReadString(), msg:ReadEntity()
Killed( victim, inflictor )
return victim, inflictor, attacker
end
usermessage.AddHook( “PlayerKilledByPlayer”, “achievements.PunchingBag”, PlayerKilledByPlayer )

achievements.Register( “Punching Bag”, “Be killed 5 times by fists.”, “achievements/generic”, total / 5, total … “/5” )

And if im using this code? where does the add money to player?