Ignore what you want to do, but this is the script I wrote to get all the weapons between levels, perhaps you can modify it to fit your needs.
-- script by 3com
-- This script is made available for free use within non-commercial or commercial projects only.
-- It cannot be scraped, modified and resold without the authors express permission.
function read_weapon_ids2_init(e)
end
function read_weapon_ids2_main(e)
if g_Entity[e]['plrinzone']==1 then
PlaySound(e,0)
Checkpoint(e)
Destroy(e)
ActivateIfUsed(e)
f = io.open("weapons_ids.txt", "r")
if f ~= nil then
t = f:read("*all")
--slen = string.len (t)
f:close()
local regex = string.format("([^%s]+)%s", ";", ";")
for id in t:gmatch(regex) do
weapon_id = id
AddPlayerWeapon(weapon_id)
PromptDuration("Replaced with " .. weapon_id,3000)
end
end
--JumpToLevelIfUsed(e)
end -- if g_Entity[e]['plrinzone']==1
end -- main
"weapons_ids.txt" file looks like this:
4;5;6;7;8;9;10;12;3;
Those numbers are the weapons ids (numbers) inn my map. (notice in your map, they can change)
I'm using regular expressions, and ";" as delimiter, and it work fine, at least for me.
hth
3omm
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics