Jump to content

[HELP] Ped


Seba500PLK

Recommended Posts

Posted

Hi, my problem is ped

function createKillPed() 
  
      local x, y, z = getElementPosition(source) 
      local rotX, rotY, rotZ = getElementRotation(source) 
      local skin = getElementModel(source) 
      local ped = createPed(0, x, y, z, rotZ) 
      pedCol = createColSphere(x, y, z, 1.5) 
      killPed(ped) 
      attachElements(pedCol, ped, 0, 0, 0) 
      setElementData(pedCol, "parent", ped) 
      setElementData(pedCol, "playername", getPlayerName(source)) 
      setElementData(pedCol, "dead", true) 
  
  
  
end 
  
  
function GetDeadName() 
  
  
  
 for i, ped in ipairs(getElementsByType("ped")) do 
  
  
if getElementData(ped, "dead") then 
  
  
local name = getElementData(ped, "playername") 
outputChatBox(name) 
  
end 
  
end 
addCommandHandler("getdeadname",GetDeadName) 
  
  
  
  
  
  

in console anyone errors

Posted

What is the problem? you get errors in the debugscript/console?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

0.o

[23:13:41] WARNING: Skrypt\s.lua:3: Bad argument @ 'getElementPosition' [Expected element at argument 1, got nil]

[23:13:41] WARNING: Skrypt\s.lua:4: Bad argument @ 'getElementRotation' [Expected element at argument 1, got nil]

[23:13:41] WARNING: Skrypt\s.lua:5: Bad argument @ 'getElementModel' [Expected element at argument 1, got nil]

[23:13:41] WARNING: Skrypt\s.lua:6: Bad argument @ 'createPed' [Expected vector3 at argument 2, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:7: Bad argument @ 'createColSphere' [Expected vector3 at argument 1, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:8: Bad argument @ 'killPed' [Expected element at argument 1, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:9: Bad argument @ 'attachElements' [Expected element at argument 1, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:10: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:11: Bad argument @ 'getPlayerName' [Expected element at argument 1, got nil]

[23:13:41] WARNING: Skrypt\s.lua:11: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]

[23:13:41] WARNING: Skrypt\s.lua:12: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]

Posted

ok, no i change on command

  
function createKillPed(player) 
  
      local x, y, z = getElementPosition(player) 
      local rotX, rotY, rotZ = getElementRotation(player) 
      local skin = getElementModel(player) 
      local ped = createPed(0, x, y, z, rotZ) 
      pedCol = createColSphere(x, y, z, 1.5) 
      killPed(ped) 
      attachElements(pedCol, ped, 0, 0, 0) 
      setElementData(pedCol, "parent", ped) 
      setElementData(pedCol, "playername", getPlayerName(player)) 
      setElementData(pedCol, "dead", true) 
  
  
  
end 
addCommandHandler("ded",createKillPed) 
  

ped is creating. I no get ped name

Posted

That's because you set the element data to the colshape, not the ped.

By the way, don't multi post, edit your previous post.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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