Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Shotgun-Melee-Only ### ]]--
- --[[ ### by H® Shaft ### ]]--
- --[[ ### for Phasor v2 ### ]]--
- -- Note: gametype weapons need to be set to: normal & generic, and infinite grenades turned off
- -- don't edit --
- team_play = false
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- if game == true or game == "PC" then
- GAME = "PC"
- gametype_base = 0x671340
- else
- GAME = "CE"
- gametype_base = 0x5F5498
- end
- Team_Play = readbyte(gametype_base + 0x34)
- if Team_Play == 1 then
- team_play = true
- else
- team_play = false
- end
- end
- function OnNewGame(map)
- if GAME == "PC" then
- gametype_base = 0x671340
- elseif GAME == "CE" then
- gametype_base = 0x5F5498
- end
- Team_Play = readbyte(gametype_base + 0x34)
- if Team_Play == 1 then
- team_play = true
- else
- team_play = false
- end
- end
- function OnPlayerJoin(player)
- welcomemsg = registertimer(6000, "timedwelcome", player)
- end
- function OnPlayerSpawn(player, m_objectId)
- if getobject(m_objectId) then
- registertimer(50, "AssignShotty", player)
- end
- end
- function AssignShotty(id, count, player)
- if getplayerobjectid(player) then
- local m_objectId = getplayerobjectid(player)
- local m_object = getobject(m_objectId)
- 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, 0)
- writebyte(m_object, 0x31F, 0)
- end
- local shotty = "weapons\\shotgun\\shotgun"
- local tag = gettagid("weap", shotty)
- local shotgun = createobject(tag, 0, 30, false, 0, 0, 0)
- local m_weapon = getobject(shotgun)
- assignweapon(player, shotgun)
- if m_weapon then
- writeword(m_weapon + 0x2B6, 0)
- writeword(m_weapon + 0x2B8, 0)
- updateammo(shotgun)
- end
- end
- end
- function timedwelcome(id, count, player)
- if count == 1 then
- if getplayer(player) then
- privatesay(player, "Kill your enemies by melee!")
- end
- end
- return true
- end
- function OnGameEnd(stage)
- if stage == 1 then
- if welcomemsg then
- removetimer(welcomemsg)
- welcomemsg = nil
- end
- end
- end
- function OnDamageLookup(receiving, causing, mapId)
- local tagname, tagtype = gettaginfo(mapId)
- if causing and receiving then
- local c_object = getobject(causing)
- local r_object = getobject(receiving)
- local melee = string.find(tagname, "melee")
- if c_object and r_object then
- local causer = objectaddrtoplayer(c_object)
- local receiver = objectaddrtoplayer(r_object)
- if causer and receiver then
- local c_team = getteam(causer)
- local r_team = getteam(receiver)
- if melee then odl_multiplier(500) end
- if team_play and c_team == r_team and causer ~= receiver then
- return false
- end
- end
- end
- end
- return nil
- end
- function OnObjectCreationAttempt(mapId, parentId, player)
- if mapId == gettagid("eqip", "weapons\\frag grenade\\frag grenade") then
- return false
- end
- if mapId == gettagid("eqip", "weapons\\plasma grenade\\plasma grenade") then
- return false
- end
- end
- function OnObjectInteraction(player, objId, mapId)
- local Pass = nil
- local name, type = gettaginfo(mapId)
- if type == "weap" then
- if name == "weapons\\assault rifle\\assault rifle" or
- name == "weapons\\ball\\ball" or
- name == "weapons\\flag\\flag" or
- name == "weapons\\flamethrower\\flamethrower" or
- name == "weapons\\needler\\mp_needler" or
- name == "weapons\\pistol\\pistol" or
- name == "weapons\\plasma pistol\\plasma pistol" or
- name == "weapons\\plasma rifle\\plasma rifle" or
- name == "weapons\\plasma_cannon\\plasma_cannon" or
- name == "weapons\\rocket launcher\\rocket launcher" or
- name == "weapons\\shotgun\\shotgun" or
- name == "weapons\\sniper rifle\\sniper rifle" then
- Pass = false
- end
- end
- if type == "eqip" then
- if name == "weapons\\frag grenade\\frag grenade" or name == "weapons\\plasma grenade\\plasma grenade" then
- Pass = false
- end
- end
- return Pass
- 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