Seba500PLK Posted January 27, 2015 Posted January 27, 2015 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
Castillo Posted January 27, 2015 Posted January 27, 2015 What is the problem? you get errors in the debugscript/console?
Seba500PLK Posted January 27, 2015 Author Posted January 27, 2015 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]
Seba500PLK Posted January 27, 2015 Author Posted January 27, 2015 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
Seba500PLK Posted January 27, 2015 Author Posted January 27, 2015 I say command getdeadname show: Bad argument @ 'outputChatBox' [Expected string at argument 1, got boolean]
Castillo Posted January 27, 2015 Posted January 27, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now