-- *** Example get peds from point script ***
-- Since: v0.2.2b
-- This command print in MISI.log
-- Script always run in game frame and break if you key press SPACE.

local gamestate = 0

while(true) do
	if (GetGameFrame() > 0) then
		if (gamestate == 0) then -- If start new game
			wait(100)
			gamestate = 1
		else
			if (IsKeyDown(0x0D)) then
				local ped_pool = GetPedFromPoint(0, 0, 0, 255)
				for i,v in ipairs(ped_pool) do
					WriteInLog(string.format("Ped index %d id %d skin %d struct %X occupation %d\n", i, GetPedID(ped_pool[i]), GetPedSkin(ped_pool[i]),  ped_pool[i], GetPedOccupation(ped_pool[i])))
				end
			end
		end
	else
		gamestate = 0
	end
end


