Object functions - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Object functions (
/showthread.php?tid=586222)
Object functions -
zaibaslr2 - 20.08.2015
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
Re: Object functions -
thaKing - 20.08.2015
Sorry, I'm dumb and a bit drunk.
Re: Object functions -
[KHK]Khalid - 20.08.2015
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)
Re: Object functions -
zaibaslr2 - 20.08.2015
Quote:
Originally Posted by [KHK]Khalid
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