I created a script that I want to come out all right, but dancing girl winner in his car. How can I do it?
function pedcreation ( player )
local x, y, z = getElementPosition ( player )
local rot = getPedRotation ( player )
peds = createPed (92, x, y, z + 2 , rot )
setPedAnimation ( peds, "DANCING", "dnce_M_a")
attachElements ( peds, player ,0.5,2,1.5)
end
addCommandHandler ( "piepie", pedcreation )
addEvent("onMapStarting")
addEventHandler("onMapStarting", getRootElement(),
function()
destroyElement(peds)
end)