Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. --- Extracts from my code, the needed stuff
  2.  
  3. --These are me creating functions
  4. function PointsForTaunt()
  5. if DEBUG or !GAMEMODE:InRound() then return false end
  6. if GetConVar("PH_POINTSHOP_POINTS_TAUNT"):GetInt() > 0 then
  7. return PS and true
  8. end
  9. end
  10.  
  11. function PH_PlayerInitialSpawn(ply)
  12.  
  13. if MapHasLua then
  14. net.Start( "LoadCurrentMapLua" )
  15. net.Send( ply )
  16. end
  17.  
  18. end
  19.  
  20.  
  21. -- These are the sections where a boolean error is being made
  22. --Section 1
  23. function FirstBlood(attacker,victim)
  24. if GetConVar("PH_FIRSTBLOOD"):GetInt() < 1 and !GAMEMODE:InRound() then return end
  25. if !FirstBlooded then
  26. local firstBloodPoints = GetConVar( "PH_POINTSHOP_FIRSTBLOOD_POINTS"):GetInt()
  27. FirstBlooded = true
  28. BroadcastMsg( Color(255,30,0), attacker:Nick().." got First Blood!" )
  29. BroadcastSound("firstblood.mp3")
  30. hook.Run("ST_FirstBlood",attacker,victim)
  31. if PointsForKill() then
  32. attacker:PS_GivePoints(firstBloodPoints)
  33. attacker:PS_Notify("First Blood for " .. tostring(firstBloodPoints) .. " extra " .. PS.Config.PointsName .. "!")
  34. end
  35. end
  36.  
  37. end
  38.  
  39. -- Section 2
  40.  
  41. if PointsForKill() then
  42. local pointsForKillAmount = GetConVar("PH_POINTSHOP_KILL_POINTS"):GetInt()
  43. attacker:PS_GivePoints(pointsForKillAmount)
  44. attacker:PS_Notify("You got " .. pointsForKillAmount .. " " .. PS.Config.PointsName .. " for killing " .. vict:Name() .. "!")
  45. end
  46.  
  47. -- Section 3
  48.  
  49. if (ply.last_point_time <= CurTime()) and (ply:Team() == TEAM_PROPS) and PointsForTaunt() then
  50. ply:PS_GivePoints(PointsForTauntAmount)
  51. ply:PS_Notify("You got " .. PointsForTauntAmount .. " " .. PS.Config.PointsName .. " for taunting!")
  52. end
  53. hook.Run("ST_Taunt",ply)
  54. end
  55. return
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement