Instead of use getcharid(0, $kill$), you just need to use $kill$ ($kill$ is actually saving the character id (char_id) and not the character name (name), so you don't need to use getcharid).
Try this:
OnClock0000:
set .prize, 7227;
set .amount, 5;
query_sql "SELECT `char_id` FROM `char_reg_num` ORDER BY `key` = 'kills' DESC LIMIT 1", $kill$;
query_sql "SELECT `name` FROM `char` WHERE `char_id`="+$kill$+"", .@name$;
if (!isloggedin(getcharid(3, .@name$))
query_sql "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify` ) VALUES ('"+$kill$+"', '"+.prize+"', '" +.amount+ "', 0, 1)";
else
getitem .prize, .amount, getcharid(3, .@name$);
end;
2017-05-17aRagexeRE and 2017-06-14aRagexeRE are brokens for me, I can't use any of them.
2016-02-03aRagexeRE is the current client that I'm using.
2017-01-25aRagexeRE.rar