Welcome to Open Carnage

A resource for gamers and technology enthusiasts, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

ThePolice

Member
  • Content count

    5
  • Joined

  • Last visited

  1. That script works really well thanks giraffe.
  2. Thanks for the help I really appreciate it. I was able to get it working but I had to change the conditional statement to if tag ~= "weapons\\flag\\flag" then if tag ~= "weapons\\ball\\ball" then destroy_object(m_weaponID) end end The way you had it should of worked but whatever. I forgot to mention that I want it so when you're holding the flag or the ball and you die, then the weapon you have in your inventory gets deleted so only the flag or ball is dropped. So wouldn't the code look like this? if m_object ~= 0 then local m_weaponID = read_dword(m_object + 0x118) --weaponID of their secondary weapon = read(m_object + 0x???) local weapon_address = get_object_memory(m_weaponID) --weapon address of secondary weapon (will = 0 if not holding the flag?) if weapon_address ~= 0 then local weapon_tag = lookup_tag(read_dword(weapon_address)) --secondary weapon tag = lookup(secondary address) if weapon_tag ~= 0 then local tag = read_string(read_dword(weapon_tag + 0x10)) --secondary tag = read(secondary weapon tag + 0x??) if tag ~= "weapons\\flag\\flag" then if tag ~= "weapons\\ball\\ball" then destroy_object(m_weaponID) end else --destroy secondary weapon end end end end end Thanks again
  3. Hi, I was wondering if someone could help me complete this script. I'm not familiar with lua but I think I already have the necessary functions in it. I think I just need to finish the OnDeath() function. Keep in mind that everyone in the mod will only spawn with one weapon. Also deleting the weapon should work at death because this worked in the events.txt: event_die wdel $n 1' api_version = "1.9.0.0" function OnScriptLoad() register_callback(cb['EVENT_DIE'],"OnDeath") end function OnDeath() --should get the map_ids object --if the weapon they were holding ~= map_ids.ball or map_ids.flag --then delete the weapon dropped end function get_map_ids() local globals_tag = read_dword(lookup_tag("matg","globals\\globals") + 0x14) if read_dword(globals_tag + 0x14C) ~= 16 or read_dword(globals_tag + 0x158) ~= 5 then return end local map_ids = {} local weapons_address = read_dword(globals_tag + 0x14C + 0x4) + 0xC map_ids.assault_rifle = read_dword(weapons_address + 0 * 16) map_ids.flamethrower = read_dword(weapons_address + 1 * 16) map_ids.gravity_rifle = read_dword(weapons_address + 2 * 16) map_ids.needler = read_dword(weapons_address + 3 * 16) map_ids.pistol = read_dword(weapons_address + 4 * 16) map_ids.plasma_pistol = read_dword(weapons_address + 5 * 16) map_ids.plasma_rifle = read_dword(weapons_address + 6 * 16) map_ids.rocket_launcher = read_dword(weapons_address + 7 * 16) map_ids.shotgun = read_dword(weapons_address + 8 * 16) map_ids.sniper_rifle = read_dword(weapons_address + 9 * 16) map_ids.frag_grenade = read_dword(weapons_address + 12 * 16) map_ids.plasma_grenade = read_dword(weapons_address + 13 * 16) map_ids.plasma_cannon = read_dword(weapons_address + 14 * 16) map_ids.mp_needler = read_dword(weapons_address + 15 * 16) local powerups_address = read_dword(globals_tag + 0x158 + 0x4) + 0xC map_ids.active_camouflage = read_dword(powerups_address + 0 * 16) map_ids.double_speed = read_dword(powerups_address + 1 * 16) map_ids.full_spectrum_vision = read_dword(powerups_address + 2 * 16) map_ids.overshield = read_dword(powerups_address + 3 * 16) map_ids.health_pack = read_dword(powerups_address + 4 * 16) local multiplayer_information = read_dword(globals_tag + 0x164 + 0x4) map_ids.ball = read_dword(multiplayer_information + 0x4C + 0xC) map_ids.flag = read_dword(multiplayer_information + 0x0 + 0xC) local vehicles_address = read_dword(multiplayer_information + 0x20 + 0x4) + 0xC map_ids.mp_warthog = read_dword(vehicles_address + 0 * 16) map_ids.ghost_mp = read_dword(vehicles_address + 1 * 16) map_ids.scorpion_mp = read_dword(vehicles_address + 2 * 16) map_ids.banshee_mp = read_dword(vehicles_address + 3 * 16) map_ids.c_gun_turret_mp = read_dword(vehicles_address + 4 * 16) map_ids.rwarthog = read_dword(vehicles_address + 5 * 16) return map_ids end function OnScriptUnload() end
  4. Yeah basically. I need to block people from picking up weapons from dead people. But with that code the flag is deleted when you pick it up.
  5. How would I write the code in the events.txt so that when you try to pick up a weapon it is immediately deleted but you can still pick up the flag and score. So far I have event_wpickup $type 1 'wdel $n 2'