Parameters for command handler are:
player playerSource, string commandName, [string arg1, string arg2, ...]
So replace:
function gerarI (targetPLayer)
with:
function gerarI (player, cmd, targetPlayer)
Also, getPlayerFromName requiers the player to enter the FULL name of target player.
You should check out this snippet:
https://wiki.multitheftauto.com/wiki/Ge ... omNamePart