Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### You've Got Balls! ###]]--
- --[[ ### Oddball Melee & Mods v1 ###]]--
- --[[ ### by H® Shaft for Phasor v2 ###]]--
- ------ NOT COMPATIBLE WITH ODDBALL GAMETYPE WITH THE "SKULL/ODDBALL" (Juggernaut and IT ok) ------
- -------------- Should be used with MODIFIED small maps, -------------
- -------------- Download Zip file with all small maps: ---------------
- -- http://www.mediafire.com/download/3231glqvi6qbppb/Halo-PC-Ball-Maps.zip
- -- gametype MUST have weapons set to "generic"
- team_play = false
- weapons = {}
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- if game == true or game == "PC" then
- GAME = "PC"
- gametype_base = 0x671340
- map_name = readstring(0x698F21)
- else
- GAME = "CE"
- gametype_base = 0x5F5498
- map_name = readstring(0x61D151)
- end
- for i=0,15 do
- if getplayer(i) then
- weapons[i] = {}
- end
- end
- gametype = readbyte(gametype_base + 0x30)
- if getteamplay() == true then team_play = true else team_play = false end
- end
- function OnNewGame(map)
- if GAME == "PC" then
- gametype_base = 0x671340
- map_name = readstring(0x698F21)
- elseif GAME == "CE" then
- gametype_base = 0x5F5498
- map_name = readstring(0x61D151)
- end
- for i=0,15 do
- if getplayer(i) then
- weapons[i] = {}
- end
- end
- gametype = readbyte(gametype_base + 0x30)
- if getteamplay() == true then team_play = true else team_play = false end
- end
- function getteamplay()
- if readbyte(gametype_base + 0x34) == 1 then
- return true
- else
- return false
- end
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- weapons[player] = nil
- sendconsoletext(player, "You've got Balls!")
- end
- end
- function OnPlayerKill(killer, victim, mode)
- if getplayer(victim) then
- weapons[victim] = nil
- end
- end
- function OnPlayerLeave(player)
- if getplayer(player) then
- weapons[player] = nil
- end
- end
- function OnPlayerSpawn(player, m_objectId)
- if getplayer(player) then
- weapons[player] = nil
- local m_objectId = getplayerobjectid(player)
- if m_objectId then
- gameweap = registertimer(0, "AssignGameWeapons", player)
- end
- end
- end
- function AssignGameWeapons(id, count, player)
- if getplayer(player) then
- local m_objectId = getplayerobjectid(player)
- local m_object = getobject(m_objectId)
- if m_objectId then
- for i = 0,3 do
- local weapID = readdword(getobject(m_objectId), 0x2F8 + i*4)
- if weapID ~= 0xFFFFFFFF then
- destroyobject(weapID)
- end
- end
- if m_object then
- writebyte(m_object + 0x31E, 1)
- writebyte(m_object + 0x31F, 1)
- end
- local m_weaponId = createobject(gettagid("weap", "weapons\\ball\\ball"), 0, 2, false, 0, 0, 0)
- weapons[player] = "weapons\\ball\\ball"
- assignweapon(player, m_weaponId)
- end
- end
- return false
- end
- function OnObjectInteraction(player, objId, mapId)
- local Pass = nil
- local name, type = gettaginfo(mapId)
- if type == "weap" then
- if gametype == 3 then
- if name == "weapons\\ball\\ball" then
- Pass = false
- elseif weapons[player] ~= nil then
- if name ~= weapons[player] then
- Pass = false
- end
- end
- else
- if weapons[player] ~= nil then
- if name ~= weapons[player] then
- Pass = false
- end
- end
- end
- end
- return Pass
- end
- function OnObjectCreationAttempt(mapId, parentId, player)
- if mapId == gettagid("weap", "weapons\\assault rifle\\assault rifle") or
- mapId == gettagid("weap", "weapons\\flamethrower\\flamethrower") or
- mapId == gettagid("weap", "weapons\\pistol\\pistol") or
- mapId == gettagid("weap", "weapons\\plasma pistol\\plasma pistol") or
- mapId == gettagid("weap", "weapons\\plasma rifle\\plasma rifle") or
- mapId == gettagid("weap", "weapons\\plasma_cannon\\plasma_cannon") or
- mapId == gettagid("weap", "weapons\\rocket launcher\\rocket launcher") or
- mapId == gettagid("weap", "weapons\\needler\\mp_needler") or
- mapId == gettagid("weap", "weapons\\shotgun\\shotgun") or
- mapId == gettagid("weap", "weapons\\sniper rifle\\sniper rifle") then
- return false
- end
- end
- function OnGameEnd(stage)
- if stage == 1 then
- if gameweap then
- removetimer(gameweap)
- gameweap = nil
- end
- end
- end
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement