Problem command


#1

command medic

 AddEventHandler("chatMessage", function(msg)
   TriggerEvent('es:getPlayerFromId', source, function(user)
    local player = user.identifier
    local namejob = nameJob(player)
    if namejob == "Medecin" then
		if msg:sub(1, 1) == "/" then
			fullcmd = stringSplit(msg, " ")
			cmd = fullcmd[1]
			args = makeArgs(fullcmd)
			if cmd == "/soin" then		
				local ped = tostring(args[1])
				CancelEvent()
				TriggerClientEvent('soin:process', source)
				TriggerClientEvent("healmedic", ped)
			end
		end
	else	
		TriggerClientEvent('soin:nopermi', source)
	end	
   end)
 end)

erreur
|Error executing event handler for event es:getPlayerFromId in resource essentialmode: Exception has been thrown by the target of an invocation.

Help me please !