Object functions
#1

Hi,
How do I make function with object id's?
Code:
GetXYInFrontOfObject(objectid, &Float:ex, &Float:ey, Float:distance, Float:customrot = -1)//441
{
	new Float:ar;
	GetDynamicObjectPos(objectid, ex, ey, ar);
	if(customrot == -1) GetDynamicObjectRot(objectid, ar);//445
	else ar = customrot;

	ex += (distance * floatsin(-ar, degrees));
	ey += (distance * floatcos(-ar, degrees));
}
../gamemodes/data/gyvunai.txt(441) : warning 213: tag mismatch
../gamemodes/data/gyvunai.txt(445) : warning 202: number of arguments does not match definition
../gamemodes/data/gyvunai.txt(445) : warning 202: number of arguments does not match definition
Reply
#2

Sorry, I'm dumb and a bit drunk.
Reply
#3

You're getting the tag mismatch warning because you have customrot declared as a float but assigned to an integer value (i.e -1). As for the other warnings, GetDynamicObjectRot takes 4 parameters I think, not only 2; GetDynamicObjectRot(objectid, Float:rotX, Float:rotY, Float:rotZ)
Reply
#4

Quote:
Originally Posted by [KHK]Khalid
View Post
You're getting the tag mismatch warning because you have customrot declared as a float but assigned to an integer value (i.e -1). As for the other warnings, GetDynamicObjectRot takes 4 parameters I think, not only 2; GetDynamicObjectRot(objectid, Float:rotX, Float:rotY, Float:rotZ)
Oh haha I'm so dumb thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)