Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Teabag Lovin by H® Shaft
- -- a crude derivation of Teabagging Script by 002, and my own script from phasor
- --When a player teabags their victim, the script will announce a random teabagging message, example:
- --"H® Shaft is makin' sweet love with 002's corpse!" or
- --"H® Shaft is butterin' the muffin with 002's corpse!"
- --etc - 25 custom messages, add your own!
- --PLUS:
- --The player will be given a random BONUS if they survive for 5 more seconds:
- --1) Restored Health, or
- --2) 2+ Frag Grenades, or
- --3) Active Camo for 20 seconds, or
- --4) Increased Speed for 20 seconds: 125% (not applicable for race game type)
- --5) Over-Shield
- -- Seconds until the teabag "expires"
- EXPIRE_TIME = 20
- -- Teabag radius in world units (1 world unit = 3 meters)
- TEABAG_RADIUS = 2/3
- -- don't edit --
- api_version = "1.9.0.0"
- crouch_time = 2
- function OnScriptLoad()
- register_callback(cb['EVENT_TICK'],"OnTick")
- register_callback(cb['EVENT_DIE'],"OnDie")
- register_callback(cb['EVENT_GAME_START'],"OnNewGame")
- register_callback(cb['EVENT_JOIN'],"OnPlayerJoin")
- register_callback(cb['EVENT_LEAVE'],"OnPlayerLeave")
- player_locations = {}
- bodies = {}
- delay = {}
- crouch = {}
- OnNewGame()
- end
- function OnScriptUnload() end
- function OnNewGame()
- for i=1,16 do
- delay[i], crouch[i] = 0, nil
- end
- end
- function OnPlayerJoin(PlayerIndex)
- if player_present(PlayerIndex) then
- delay[PlayerIndex], crouch[PlayerIndex] = 0, nil
- end
- end
- function OnPlayerLeave(PlayerIndex)
- delay[PlayerIndex], crouch[PlayerIndex] = nil, nil
- end
- function OnTick()
- local time = os.clock()
- for i=#bodies,1,-1 do
- if(bodies[i].Expires < time) then
- table.remove(bodies,i)
- end
- end
- for i=1,16 do
- if(player_alive(i)) then
- local player_object = get_dynamic_player(i)
- local x,y,z = read_vector3d(player_object + 0x5C)
- local vehicle_objectid = read_dword(player_object + 0x11C)
- local vehicle_object = get_object_memory(vehicle_objectid)
- local id = get_var(i, "$n")
- if delay[i] > 0 then delay[i] = delay[i] - 1 end
- if (vehicle_object ~= 0) then
- local a,b,c = read_vector3d(vehicle_object + 0x5C)
- x=x+a
- y=y+b
- z=z+c
- elseif (bit.band(read_dword(player_object + 0x208),1) == 1) and (crouch[i] == nil) and (delay[i] == 0) then
- local hash = get_var(i,"$hash")
- for k=#bodies,1,-1 do
- if(bodies[k].KillerHash == hash) then
- if(DistanceFormula(x,y,z,bodies[k].x,bodies[k].y,bodies[k].z) < TEABAG_RADIUS) then
- local sexact = generatesexact(sexslang)
- TEABAG_MESSAGE = "$KILLER is " .. sexact .. " with $VICTIM's corpse!"
- say_all(string.gsub(string.gsub(TEABAG_MESSAGE,"$VICTIM",bodies[k].OwnerName),"$KILLER",get_var(i,"$name")))
- table.remove(bodies,k)
- delay[i] = (crouch_time*30)
- crouch[i] = rand(1,6)
- if (crouch[i] == 1) then
- timer(5000, "Bonus_Health", i)
- elseif (crouch[i] == 2) then
- timer(5000, "Bonus_Frags", i)
- elseif (crouch[i] == 3) then
- timer(5000, "Bonus_Camo", i)
- elseif (crouch[i] == 4) then
- timer(5000, "Bonus_Speed", i)
- elseif (crouch[i] == 5) then
- timer(5000, "Bonus_OverShield", i)
- end
- end
- end
- end
- elseif (bit.band(read_dword(player_object + 0x208),1) ~= 1) and (crouch[i] ~= nil) then
- crouch[i] = nil
- end
- player_locations[i] = {}
- player_locations[i].x = x
- player_locations[i].y = y
- player_locations[i].z = z
- end
- end
- end
- function OnDie(PlayerIndex,KillerIndex)
- delay[PlayerIndex], crouch[PlayerIndex] = 0, nil
- KillerIndex = tonumber(KillerIndex)
- if(player_locations[PlayerIndex] and KillerIndex > 0 and PlayerIndex ~= KillerIndex) then
- local entry = {}
- entry.OwnerName = get_var(PlayerIndex,"$name")
- entry.KillerHash = get_var(KillerIndex,"$hash")
- entry.x = player_locations[PlayerIndex].x
- entry.y = player_locations[PlayerIndex].y
- entry.z = player_locations[PlayerIndex].z
- entry.Expires = os.clock() + EXPIRE_TIME
- bodies[#bodies + 1] = entry
- end
- end
- function DistanceFormula(x1,y1,z1,x2,y2,z2)
- return math.sqrt(math.pow(x1 - x2,2) + math.pow(y1 - y2,2) + math.pow(z1 - z2,2))
- end
- function generatesexact(sexslang)
- local sexsayin = {"makin' sweet love", "bumpin' uglies", "bumpin' fuzzies", "butterin' the muffin",
- "doin' the funky chicken", "ridin' the wild pony", "makin' bacon", "doggie-stylin'", "playin' hide the salami",
- "slappin' bellies", "glazin' the doughnut", "burying the pickle", "shuckin' the corn-cob", "chilli-doggin",
- "dirty sanchezin'", "knockin' boots", "goin' to the boneyard", "sinkin' the sausage", "marinatin' the mutton",
- "ridin' the skin bus to tuna town", "hidin' the canoli", "spelunkin' the bat cave", "makin' banana pudding",
- "puttin' the devil into hell", "bashin' the beaver", "feedin' the kitty", "smackin' The salmon", "gettin' jiggy",
- }
- local sexcount = #sexsayin
- local sex_verb = rand(1, sexcount+1)
- local sex_type = string.format("%s", sexsayin[sex_verb])
- if (sex_type ~= nil) then
- return sex_type
- else
- return "makin' sweet love"
- end
- end
- function Bonus_Frags(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- if player_alive(PlayerIndex) then
- execute_command("nades me +2 1", PlayerIndex)
- rprint(PlayerIndex, "Bonus: 2+ Frag Grenades!")
- say_all(get_var(PlayerIndex,"$name") .. " was given a tea-bagging bonus: 2+ Frag Grenades!")
- end
- end
- return false
- end
- function Bonus_Speed(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- local game_type = get_var(0,"$gt")
- if (game_type ~= "race") then
- if player_alive(PlayerIndex) then
- execute_command("s me +0.25", PlayerIndex)
- rprint(PlayerIndex, "Bonus: 125% Speed!")
- say_all(get_var(PlayerIndex,"$name") .. " was given a tea-bagging bonus: 125% Speed!")
- timer(20000, "Reset_Speed", PlayerIndex)
- end
- end
- end
- return false
- end
- function Reset_Speed(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- local game_type = get_var(0,"$gt")
- if (game_type ~= "race") then
- if player_alive(PlayerIndex) then
- execute_command("s me 1", PlayerIndex)
- end
- end
- end
- return false
- end
- function Bonus_Health(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- if player_alive(PlayerIndex) then
- local player_object = get_dynamic_player(PlayerIndex)
- if (player_object ~= 0) then
- local obj_health = tonumber(get_var(PlayerIndex, "$hp"))
- if obj_health < 1 then
- write_float(player_object + 0xE0, 1)
- rprint(PlayerIndex, "Bonus: Your health has been restored!")
- say_all(get_var(PlayerIndex,"$name") .. " was given a tea-bagging bonus: Restored Health")
- end
- end
- end
- end
- return false
- end
- function Bonus_Camo(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- if player_alive(PlayerIndex) then
- local player_object_id = read_dword(get_player(PlayerIndex) + 0x34)
- local player_object = get_dynamic_player(PlayerIndex)
- if (player_object ~= 0) then
- if (read_dword(get_object_memory(player_object_id) + 0x204) ~= 0x51) then
- camo(PlayerIndex, 20*30)
- rprint(PlayerIndex, "Bonus: You have been given active-camouflage!")
- say_all(get_var(PlayerIndex,"$name") .. " was given a tea-bagging bonus: Active-Camo")
- end
- end
- end
- end
- return false
- end
- function Bonus_OverShield(PlayerIndex)
- if get_var(0, "$gt") ~= "n/a" then
- if player_alive(PlayerIndex) then
- local ObjectID = spawn_object("eqip", "powerups\\over shield")
- powerup_interact(ObjectID, PlayerIndex)
- rprint(PlayerIndex, "Bonus: You have been given an over-shield!")
- say_all(get_var(PlayerIndex,"$name") .. " was given a tea-bagging bonus: Over-Shield")
- end
- end
- return false
- end
- function OnError(Message)
- print(debug.traceback())
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
- -- The player -db-GoNe/Juhleek - a well spoken liar, cheat.
- -- -db- is: "diverging from the believable" - How ironic. A race clan where admins use rcon to favor themselves to win.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement