Jump to content

create marker from table??


Stevenn

Recommended Posts

okay thanks, it works but if i want to change it to peds and i want to set the rotation?

local sellerPeds = 
{ 
    { nX = 0, nY = 0, nZ = 10 }; 
    { x = -1539, y = 126, z = 3, rotX = 0, rotY = 0, rotZ = 0 }; 
} 
  
for _, t in pairs( sellerPeds  ) do 
    sellerped = createPed ( 1, t.x, t.y, t.z, "cylinder", 2, 250,250,250 ) 
    setElementRotation ( serllerped, t.rotX, t.rotY, t.rotZ ) 
end 

??

Link to comment

Yes.

But you have mistake with this

What is it? Arguments wrong. Read wiki https://wiki.multitheftauto.com/wiki/CreatePed

  
sellerped = createPed ( 1, t.x, t.y, t.z, "cylinder", 2, 250,250,250 ) 
  

  
    setElementRotation ( serllerped, t.rotX, t.rotY, t.rotZ ) -- sellerped not defined 
  

And you should use ( for peds, players )

setPedRotation 

instead of

setElementRotation 

https://wiki.multitheftauto.com/wiki/Scr ... troduction

Edited by Guest
Link to comment
Yes.

But you have mistake with this

  
sellerped = createPed ( 1, t.x, t.y, t.z, "cylinder", 2, 250,250,250 ) 
    setElementRotation ( serllerped, t.rotX, t.rotY, t.rotZ ) -- sellerped not defined 
  

And you should use

setPedRotation 

instead of

setElementRotation 

i changed serllerped to sellerpad as it was a typo, although its still the same error!

Link to comment

I can't understand what you mean with not defined..

i tried

local sellerPeds = 
{ 
    { nX = 0, nY = 0, nZ = 10 }; 
    { x = -1539, y = 126, z = 3, rotX = 0, rotY = 0, rotZ = 0 }; 
} 
  
for _, t in pairs( sellerPeds ) do 
 local sell = createPed ( 1, t.x, t.y, t.z ) 
    setPedRotation ( sell, t.rotX, t.rotY, t.rotZ ) -- sellerped not defined 
end 

Link to comment
setPedRotation ( sell, t.rotX, t.rotY, t.rotZ ) 

Read arguments!

I can't understand what you mean with not defined..

Example

  
print( f( ) ) -- Call not defined function f 
-- Output: nil 
-- Debug: attempt to call global 'f' (a nil value) 
  

Edited by Guest
Link to comment
local tSellerPeds = 
{ 
    { nX = -1539, nY = 126, z = 3, nRotZ = 0 }; 
} 
  
for _, t in pairs( tSellerPeds ) do 
    local uPedSell = createPed ( 1, t.nX, t.nY, t.nZ ) 
    setPedRotation ( uPedSell, t.nRotZ ) 
end 

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...