Jump to content

CreatePed


Lloyd Logan

Recommended Posts

Whats up with this. frustrating me, it should be so simple to fix it!

Unexpected symbol near .. that is line 3

function pedLoad ( name ) 
    local x, y, z = getElementPosition(thePlayer) 
    createPed (120, .. x .., .. y .., .. z,) 
        outputChatBox("Successful!", thePlayer, 255, 0, 0) 
end 
addEventHandler ( "createped", pedLoad ) 

Link to comment

I had this problem yesterday, change the command.

And no joke, I actually made this yeterday:

function pedcreation(player) 
local x,y,z = getElementPosition(player) 
local xr,xy,xz = getElementRotation(player) 
peds = createPed(288,x,y,z-1,xr,xy,xz) 
setElementRotation(peds, xr,xy,xz) 
end 
addCommandHandler("piepie",pedcreation) 

But, its because createped is a function name, so you can't use it as a command.

Oh, and thePlayer is not in the function ( ) ' s

Link to comment
addCommandHandler("piepie",  
    function(client) 
    local x, y, z = getElementPosition(client) 
    local rotx, roty, rotz = getElementRotation(client) 
    local ped = createPed(288, x, y, z, rotz) 
    if (ped) then outputChatBox("Successful!",client, 255, 0, 0) end 
end) 

Link to comment
I had this problem yesterday, change the command.

And no joke, I actually made this yeterday:

function pedcreation(player) 
local x,y,z = getElementPosition(player) 
local xr,xy,xz = getElementRotation(player) 
peds = createPed(288,x,y,z-1,xr,xy,xz) 
setElementRotation(peds, xr,xy,xz) 
end 
addCommandHandler("piepie",pedcreation) 

But, its because createped is a function name, so you can't use it as a command.

Oh, and thePlayer is not in the function ( ) ' s

Haha, thanks alot,

and does anyone know how to be able to choose the skin?

Link to comment

Just put it where you need specifying required arguments.

function pedcreation(player) 
local x,y,z = getElementPosition(player) 
local xr,xy,xz = getElementRotation(player) 
peds = createPed(288,x,y,z-1,xr,xy,xz) 
setElementRotation(peds, xr,xy,xz) 
setPedSkin(peds,50) -- This sets ped skin to 50 (mechanic skin) 
end 
addCommandHandler("piepie",pedcreation) 

Link to comment
Just put it where you need specifying required arguments.
function pedcreation(player) 
local x,y,z = getElementPosition(player) 
local xr,xy,xz = getElementRotation(player) 
peds = createPed(288,x,y,z-1,xr,xy,xz) 
setElementRotation(peds, xr,xy,xz) 
setPedSkin(peds,50) -- This sets ped skin to 50 (mechanic skin) 
end 
addCommandHandler("piepie",pedcreation) 

How do i choose, if you know what i mean, like,

/piepie (skinid)

Link to comment
function pedcreation ( player, cmd, skin ) 
    local x, y, z = getElementPosition ( player ) 
    local rot = getPedRotation ( player ) 
    peds = createPed ( tonumber ( skin ) or 0, x, y, z - 1 , rot ) 
end 
addCommandHandler ( "piepie", pedcreation ) 

setPedSkin is outdated btw.

Link to comment
Just put it where you need specifying required arguments.
function pedcreation(player) 
local x,y,z = getElementPosition(player) 
local xr,xy,xz = getElementRotation(player) 
peds = createPed(288,x,y,z-1,xr,xy,xz) 
setElementRotation(peds, xr,xy,xz) 
setPedSkin(peds,50) -- This sets ped skin to 50 (mechanic skin) 
end 
addCommandHandler("piepie",pedcreation) 

How do i choose, if you know what i mean, like,

/piepie (skinid)

function pedcreation (client, cmd, skinid) 
    if not (skinid) then outputChatBox("Usage: /piepie skinid", client, 250, 0, 0) return end 
    local x, y, z = getElementPosition(client) 
    local rotx, roty, rotz = getElementRotation(client) 
    createPed(skinid, x, y, z, rotz) 
end 
addCommandHandler("piepie", pedcreation) 

Link to comment
function pedcreation ( player, cmd, skin ) 
    local x, y, z = getElementPosition ( player ) 
    local rot = getPedRotation ( player ) 
    peds = createPed ( tonumber ( skin ) or 0, x, y, z - 1 , rot ) 
end 
addCommandHandler ( "piepie", pedcreation ) 

setPedSkin is outdated btw.

I love you!!!!

But thanks everyone else!!

Link to comment
function pedcreation ( player, cmd, skin ) 
    local x, y, z = getElementPosition ( player ) 
    local rot = getPedRotation ( player ) 
    peds = createPed ( tonumber ( skin ) or 0, x, y, z - 1 , rot ) 
end 
addCommandHandler ( "piepie", pedcreation ) 

setPedSkin is outdated btw.

Maybe i am pushing this a bit far, but how to make them walk?

Link to comment
function pedcreation ( player, cmd, skin ) 
    local x, y, z = getElementPosition ( player ) 
    local rot = getPedRotation ( player ) 
    peds = createPed ( tonumber ( skin ) or 0, x, y, z - 1 , rot ) 
    setPedAnimation(peds, "ped", "WOMAN_walknorm") 
end 
addCommandHandler ( "piepie", pedcreation ) 

Link to comment
function pedcreation ( player, cmd, skin ) 
    local x, y, z = getElementPosition ( player ) 
    local rot = getPedRotation ( player ) 
    peds = createPed ( tonumber ( skin ) or 0, x, y, z - 1 , rot ) 
    setPedAnimation(peds, "ped", "WOMAN_walknorm") 
end 
addCommandHandler ( "piepie", pedcreation ) 

Thank you so much!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...