I'm assuming you've set the Lua file in question to InGameUIAddin already. (I assume this because if you know enough about Lua to write that kind of function, you know how to enable Lua.) If not, then that's your problem.
Besides, you can just ask. The first argument of SerialEventUnitCreated is the player's ID, the second argument is the unit's ID (but note that units are only unique within a single player; two separate civs can have units with the same ID). You can easily convert these to the usual structures by something like:
Code:
mPlayer = Players[iPlayer];
mUnit = Players[iPlayer]:GetUnitByID(iUnit);
Those are really the only two arguments you ever need. At that point, you just use something like
Code:
mType = mUnit:GetUnitType();
mCombat = GameInfo.Units[mType].Combat;
to get the unit's combat rating, or similar lines for other variables.
There are 13 arguments, and I don't know what the other 11 do (since the existing game doesn't seem to use that function in any of the publicly-available assets). Arguments 3, 7, and 8 are tables, 11, 12, and 13 are booleans, and the rest are integers.
Now, note that the function will fire any time the unit's 3D MODEL enters the game. That means when it is created, when it embarks, when it disembarks, when you load a new savegame, and so on. So if you're trying to do something to the unit, like add extra XP for certain unit types, then you have to do a LOT more to ensure the player doesn't abuse it.
For instance, in my mod, the script gives a custom promotion ("Rookie") to newly-created units, that's automatically removed after their first fight. So my OnUnitCreated script checks to see if that promotion is present; if not, the unit must be new and so gets whatever extra benefits I wanted, but if it has it, OR if the unit was created on a previous turn (since the unit's creation turn is stored in its structure), then do nothing.