qbcore-framework / qb-target

A better interaction system for FiveM
GNU General Public License v3.0
94 stars 240 forks source link

[BUG] exports['qb-target']:SpawnPed not working #161

Closed SuelTheDev closed 2 years ago

SuelTheDev commented 2 years ago

I'm trying to use the SpawnPed function export, but nothing happens, I've tested it with my own code and the example code that comes in the github and both nothing happens.

To Reproduce Steps to reproduce the behavior:

  1. I call this function in my client code.

    exports["qb-target"]:SpawnPed({ model = 'a_m_y_business_02', coords = vector4(453.49, -608.09, 28.58, 264.58), freeze = true, invincible = true, blockevents = true, target = { useModel = false, options = { { type = 'client', event = "test", label = "Entrar em serviço", icon = "fas fa-example" } }, distance = 2.5 }, action = function(spawndata) print("PED SPAWNED", spawndata) end })

Expected behavior A clear and concise description of what you expected to happen.

That the PED is created and the target functions are associated with it to make the interaction.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

singh-manavv commented 2 years ago

You need to put the ped model name inside double or single inverted commas "a_m_y_business_02" or 'a_m_y_business_02'

SuelTheDev commented 2 years ago

You need to put the ped model name inside double or single inverted commas "a_m_y_business_02" or 'a_m_y_business_02'

In the original code there are the "", must have happened during the copy and paste, but I just discovered that there is a spawnNow property, which is not in the documentation, at least not in my last query.