Jump to content

[Help]BadArgumant and Boolean


Recommended Posts

Posted (edited)
[2018-07-10 14:19:03] WARNING: [gameplay]/yaratik/zombie_server.lua:320: Bad argument @ 'getElementPosition' [Expected element at argument 1]
[2018-07-10 14:19:03] WARNING: [gameplay]/yaratik/zombie_server.lua:321: Bad argument @ 'getElementPosition' [Expected element at argument 1]
[2018-07-10 14:19:03] WARNING: [gameplay]/yaratik/zombie_server.lua:322: Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 1, got boolean]

 

ED3ApB.png

--CHECKS FOR ZOMBIE GRABBING FROM BEHIND
function Playerthroatbitten ( player, attacker)
	local Zx, Zy, Zz = getElementPosition( attacker )
	local Px, Py, Pz = getElementPosition( player )
	local distance = (getDistanceBetweenPoints3D( Px, Py, Pz, Zx, Zy, Zz ))
	if (distance < 1) then    ----323.dize
		killPed ( player, attacker, weapon, bodypart )
	else
		setPedAnimation (player)
	end
end

 

 

Edited by Yurigarga
Posted

You're not passing player nor attacker into the function, leading to getElementPositions to fail, returning false, which means you don't have actual XYZ positions to compare distance off - you're plugging a bool (false) into what was supposed to be a number (or Vector3)

  • Like 1

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