Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- weapons = {}
- registertimer(10, "WeaponMonitor")
- function WeaponMonitor(id, count)
- for player = 0,15 do
- weapons[player] = weapons[player] or {}
- local m_player = getplayer(player)
- if m_player then
- local objId = readdword(m_player, 0x34)
- local m_object = getobject(objId)
- if m_object then
- for i = 0,3 do
- local weapId = readdword(m_object, 0x2F8 + (i * 4))
- local m_weapon = getobject(weapId)
- if m_weapon then
- local mapId = readdword(m_weapon)
- if weapons[player][i] then
- if weapons[player][i].weapId ~= weapId then
- OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
- weapons[player][i] = {}
- weapons[player][i].weapId = weapId
- weapons[player][i].mapId = mapId
- OnWeaponPickup(player, weapId, i, mapId)
- end
- else
- weapons[player][i] = {}
- weapons[player][i].weapId = weapId
- weapons[player][i].mapId = mapId
- OnWeaponPickup(player, weapId, i, mapId)
- end
- else
- if weapons[player][i] then
- OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
- weapons[player][i] = nil
- end
- end
- end
- else
- for i = 0,3 do
- if weapons[player][i] then
- OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
- weapons[player][i] = nil
- end
- end
- end
- end
- end
- return true
- end
- function OnWeaponPickup(player, weapId, slot, mapId)
- end
- function OnWeaponDrop(player, weapId, slot, mapId)
- end
Advertisement
Add Comment
Please, Sign In to add comment