Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1.  
  2. SURF.MapCompleted1 = SURF.MapCompleters or {}
  3. SURF.MapCompleted2 = SURF.MapCompleted2 or {}
  4. SURF.MapCompleted3 = SURF.MapCompleted3 or {}
  5. hook.Add("PlayerInitialSpawn", "Surf.SetPlayerPoints", function(ply)
  6. ply:SetNWInt("SurfExperience", ply:GetPData("SurfExperience", 0))
  7. end)
  8.  
  9. hook.Add("PlayerCompletedSurfMap", "Surf.AddEXP", function(ply)
  10. --Check for all 3 completes
  11. if table.HasValue(SURF.MapCompleted1, ply:SteamID() ) and table.HasValue(SURF.MapCompleted2, ply:SteamID() ) and table.HasValue(SURF.MapCompleted3, ply:SteamID() ) then return end
  12. --Completed once? No? Give them shit.
  13. if not table.HasValue( SURF.MapCompleted1, ply:SteamID() ) then
  14. ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  15. ply:PS_GivePoints(SURF.EndingPoints*2)
  16. SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  17. -- // For Double XP weekends Disable the TOP! \\ --
  18. --ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  19. --ply:PS_GivePoints(SURF.EndingPoints*2)
  20. --SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  21. table.insert(SURF.MapCompleted1, ply:SteamID())
  22.  
  23.  
  24. end
  25. --Completed a second time? No? Give them shit.
  26. if table.HasValue (SURF.MapCompleted1, ply:SteamID() ) then
  27. if not table.HasValue( SURF.MapCompleted2, ply:SteamID() ) then
  28. ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  29. ply:PS_GivePoints(SURF.EndingPoints*2)
  30. SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  31. -- // For Double XP weekends Disable the TOP! \\ --
  32. --ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  33. --ply:PS_GivePoints(SURF.EndingPoints*2)
  34. --SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  35. table.insert(SURF.MapCompleted2, ply:SteamID())
  36. end
  37. end
  38. --Completed for the last time? No? Give them shit.
  39. if table.HasValue (SURF.MapCompleted1, ply:SteamID()) and table.HasValue (SURF.MapCompleted2, ply:SteamID()) then
  40. if not table.HasValue( SURF.MapCompleted3, ply:SteamID() ) then
  41. ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  42. ply:PS_GivePoints(SURF.EndingPoints*2)
  43. SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  44. -- // For Double XP weekends Disable the TOP! \\ --
  45. --ply:AddSurfXP( math.floor(SURF.EndingPoints/1) or 0)
  46. --ply:PS_GivePoints(SURF.EndingPoints*2)
  47. --SURF:SendText( { color_white, "You have been awarded ", SURF['Config']['NotifyColor'], tostring(string.Comma(math.floor(SURF.EndingPoints*2))), color_white, " XP and ", SURF['Config']['NotifyColor'], "$", tostring(string.Comma(SURF.EndingPoints*4)), color_white, " for completing the map. Remember, Its DoubleXP!" }, ply )
  48. table.insert(SURF.MapCompleted3, ply:SteamID())
  49. end
  50. end
  51. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement