Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AddEXP( ply, hitgroup, dmginfo )
- local attacker = dmginfo:GetAttacker()
- if attacker:IsPlayer() then
- if attacker:IsUserGroup("VIP") then
- if EXP_STOPATMAX == 1 and attacker:GetNWInt("CurLevel") == levelups[table.Count(levelups)] then return end
- attacker:SetNWInt("Exp",attacker:GetNWInt("Exp")+2)
- Msg("VIP exp")
- else
- if EXP_STOPATMAX == 1 and attacker:GetNWInt("CurLevel") == levelups[table.Count(levelups)] then return end
- attacker:SetNWInt("Exp",attacker:GetNWInt("Exp")+EXP_INC)
- Msg("Normal exp")
- end
- if table.HasValue(levelups,attacker:GetNWInt("Exp")) then
- local leveln = 1
- for k,v in ipairs(levelups) do if v == attacker:GetNWInt("Exp") then leveln = k end end
- if leveln == table.Count(levelups) then PrintAll(attacker:Name().." has reached the maximum level!")
- else PrintAll(attacker:GetName().." has now reached level "..leveln.."!") end
- attacker:SetNWInt("NextLevel",levelups[leveln+1])
- attacker:SetNWInt("CurLevel",levelups[leveln])
- attacker:SetNWInt("LevelNum",leveln)
- attacker:SendLua("surface.PlaySound(\"achievements/achievement_earned.mp3\")")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement