Perdón por responder tarde.
Éste es el código antes que ejecuta la función.
peds = {}
function crear ( thePlayer )
if peds [ thePlayer ] == nil then
peds [ thePlayer ] = 0
end
if peds [ thePlayer] < 1 and peds [ thePlayer ] == 0 then
local x, y, z = getElementPosition ( thePlayer )
outputChatBox ( "* Has creado tu ped satisfactoriamente.", thePlayer, 0, 255, 120 )
local mascota = createPed ( 299, x, y, z )
seguir(mascota, thePlayer)
peds [ thePlayer ] = 1
addCommandHandler("delped",
function ( thePlayer, mascota )
if mascota then
deleteElement(mascota)
outputChatBox("* Has borrado el Ped correctamente.", thePlayer, 0, 255, 120)
peds [ thePlayer ] = 0
else
outputChatBox ( "* No tienes peds creados.", thePlayer, 255, 0, 0 )
end
end)
else
outputChatBox ( "No puedes crear más peds.", thePlayer, 0, 255, 120)
end
end
addCommandHandler("myped", crear)