Seba500PLK Posted January 27, 2015 Share 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 Link to comment
Castillo Posted January 27, 2015 Share Posted January 27, 2015 What is the problem? you get errors in the debugscript/console? Link to comment
Seba500PLK Posted January 27, 2015 Author Share Posted January 27, 2015 console no Debugscript one moment Link to comment
Seba500PLK Posted January 27, 2015 Author Share 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] Link to comment
Seba500PLK Posted January 27, 2015 Author Share 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 Link to comment
Seba500PLK Posted January 27, 2015 Author Share Posted January 27, 2015 I say command getdeadname show: Bad argument @ 'outputChatBox' [Expected string at argument 1, got boolean] Link to comment
Castillo Posted January 27, 2015 Share 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. Link to comment
Seba500PLK Posted January 27, 2015 Author Share Posted January 27, 2015 yeaaa, sorry and solved Thanks Link to comment
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