Advertisement
HR_Shaft

Tea-Bag Lovin v1-057 for Phasor 10057

Apr 26th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.31 KB | None | 0 0
  1. --[[ ###      Tea-Bag Lovin v1-057   ###]]--
  2. --[[ ### for Phasor 057 by H® Shaft  ###]]--
  3.  
  4. -- Detects victim location. You must be near the victims death to be able to tea-bag them.
  5. -- derived from AelitePrime's t-bag script, but with fixes, he had errors on lines 52 and 56 (receiver_id) which caused it not to work.
  6. -- added some stanky lovin to it: When a player tea-bags their victim, it announces various phrases:
  7. -- "H® Shaft is playin' hide the salami with Oxide's corpse!" or "H® Shaft is ridin' the wild pony with Oxide's corpse!"
  8. -- 10 Different variations, add your own! (add a quoted sex act to the sexsayin table at the bottom, separated by a comma)
  9. -- yes, you can now tea-bag your own corpse, you sick self-lovin bastard.
  10.  
  11. -- don't edit --
  12. crouch = {}
  13. victim_coords = {}
  14. tbag = {}
  15.  
  16. function GetRequiredVersion()
  17.     return 10057
  18. end
  19.  
  20. function OnClientUpdate(player, m_objectId)
  21.     local m_player = getplayer(player)
  22.     local id = resolveplayer(player)
  23.     local m_objectId = getplayerobjectid(player)
  24.     local m_object = getobject(m_objectId) 
  25.     if tbag[player] == nil then
  26.         tbag[player] = {}
  27.     end
  28.     if m_objectId then
  29.         if tbag[player].name and tbag[player].x then
  30.             if check_sphere(m_objectId, tbag[player].x, tbag[player].y, tbag[player].z, 10) then
  31.                 if m_object then
  32.                     if getobject(readdword(m_object, 0x11C)) == nil then
  33.                         local obj_crouch = readbyte(m_object, 0x2A0)
  34.                         if obj_crouch == 3 and crouch[id] == nil then
  35.                             crouch[id] = OnPlayerCrouch(player)
  36.                         elseif obj_crouch ~= 3 then
  37.                             crouch[id] = nil
  38.                         end
  39.                     end
  40.                     if crouch[id] == false then
  41.                         writebit(m_object, 0x208, 7, 0)
  42.                     end
  43.                 end
  44.             end
  45.         end
  46.     end
  47. end
  48.  
  49. function OnPlayerKill(killer, victim, mode)
  50.     tbag[victim] = {}
  51.     if mode == 4 then
  52.         tbag[killer].count = 0
  53.         tbag[killer].name = getname(victim)
  54.         if victim_coords[victim] == nil then victim_coords[victim] = {} end
  55.         if victim_coords[victim].x then
  56.             tbag[killer].x = victim_coords[victim].x
  57.             tbag[killer].y = victim_coords[victim].y
  58.             tbag[killer].z = victim_coords[victim].z
  59.         end
  60.     elseif mode == 6 then
  61.         tbag[victim].count = 0
  62.         tbag[victim].name = getname(victim)
  63.         if victim_coords[victim] == nil then victim_coords[victim] = {} end
  64.         if victim_coords[victim].x then
  65.             tbag[victim].x = victim_coords[victim].x
  66.             tbag[victim].y = victim_coords[victim].y
  67.             tbag[victim].z = victim_coords[victim].z
  68.         end
  69.     end
  70. end
  71.  
  72. function OnDamageLookup(receiving_obj, causing_obj, tagdata, tagname)
  73.     local receiver = objecttoplayer(receiving_obj)
  74.     local causer = objecttoplayer(causing_obj)
  75.     if receiver ~= nil then
  76.         local r_object = getobject(receiver)
  77.         if r_object then
  78.             local x,y,z = getobjectcoords(receiver)
  79.             if victim_coords[receiver] == nil then
  80.                 victim_coords[receiver] = {}
  81.             end
  82.             if victim_coords[receiver] then
  83.                 victim_coords[receiver].x = x
  84.                 victim_coords[receiver].y = y
  85.                 victim_coords[receiver].z = z
  86.             end
  87.         end
  88.     end
  89. end
  90.  
  91. function OnPlayerCrouch(player)
  92.     if tbag[player].count == nil then
  93.         tbag[player].count = 0
  94.     end
  95.     tbag[player].count = tbag[player].count + 1
  96.     if tbag[player].count == 4 then
  97.         tbag[player].count = 0
  98.         local sexact = generatesexact(sexslang)
  99.         say(getname(player).. " is " .. sexact .. " with " .. tbag[player].name .. "'s corpse!")
  100.         tbag[player].name = nil
  101.     end
  102.     return true
  103. end
  104.  
  105. function check_sphere(m_objectId, X, Y, Z, R)
  106.     local Pass = false
  107.     if getobject(m_objectId) then
  108.         local x,y,z = getobjectcoords(m_objectId)
  109.         if (X - x)^2 + (Y - y)^2 + (Z - z)^2 <= R then
  110.             Pass = true
  111.         end
  112.     end
  113.     return Pass
  114. end
  115.  
  116. function generatesexact(sexslang)
  117.     local sexcount = #sexsayin
  118.     local sex_verb = getrandomnumber(1, sexcount+1)
  119.     local sex_type = string.format("%s",  sexsayin[sex_verb])
  120.     if sex_type then
  121.         return sex_type
  122.     else
  123.         return nil
  124.     end
  125. end
  126.  
  127. sexsayin = {"makin' sweet love", "bumpin' uglies", "bumpin' fuzzies", "butterin' the muffin", "doin' the funky chicken",
  128. "ridin' the wild pony", "makin' bacon", "doggie-stylin'", "playin' hide the salami", "slappin' bellies", "humpin' the rump"}
  129.  
  130. function OnScriptLoad(process) end
  131. function OnGameEnd(mode) end
  132. function OnServerChat(player, chattype, message) return 1 end
  133. function OnPlayerSpawn(player, m_objectId) end
  134. function OnScriptUnload() end
  135. function OnNewGame(map) end
  136. function OnServerCommand(player, command) return 1 end
  137. function OnTeamDecision(team) return team end
  138. function OnPlayerJoin(player, team) end
  139. function OnPlayerLeave(player, team) end
  140. function OnKillMultiplier(player, multiplier) end
  141. function OnPlayerSpawnEnd(player, m_objectId) end
  142. function OnTeamChange(relevant, player, team, dest_team) return 1 end
  143. function OnWeaponReload(player, weapon) return 1 end
  144. function OnVehicleEject(player, forceEject) return 1 end
  145. function OnWeaponAssignment(player, object, count, tag) end
  146. function OnObjectCreation(m_objectId, player_owner, tag) end
  147. function OnVehicleEntry(relevant, player, vehicleId, vehicle_tag, seat) return 1 end
  148. function OnObjectInteraction(player, m_ObjectId, tagType, tagName) return 1 end
  149.  
  150. -- functions by Oxide, Smiley, Chalonic & =CE= Chris --
  151. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  152. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  153. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement