SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/08/2015, 01:05 PM   #1
zaibaslr2
Big Clucker
 
Join Date: Dec 2009
Location: Lithuania
Posts: 199
Reputation: 24
Default Object functions

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
__________________
5 years with SA-MP forum!
zaibaslr2 is offline   Reply With Quote
Old 20/08/2015, 01:13 PM   #2
thaKing
Huge Clucker
 
thaKing's Avatar
 
Join Date: Feb 2014
Location: Mushroom fields
Posts: 293
Reputation: 37
Default Re: Object functions

Sorry, I'm dumb and a bit drunk.
thaKing is offline   Reply With Quote
Old 20/08/2015, 01:21 PM   #3
[KHK]Khalid
Gangsta
 
[KHK]Khalid's Avatar
 
Join Date: Jan 2012
Location: Alexandria, Egypt
Posts: 854
Reputation: 136
Default Re: Object functions

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)
[KHK]Khalid is offline   Reply With Quote
Old 20/08/2015, 02:18 PM   #4
zaibaslr2
Big Clucker
 
Join Date: Dec 2009
Location: Lithuania
Posts: 199
Reputation: 24
Default Re: Object functions

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
__________________
5 years with SA-MP forum!
zaibaslr2 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] LSF - Lorenc's Simple Functions (w/ gang/clan functions) Lorenc_ Includes 14 21/04/2018 04:06 AM
[Include] exobjects - Extended object functions kristo Includes 2 11/12/2013 06:01 PM
Pawno functions Doesn't Show on the functions Tab silvan Scripting Help 2 11/11/2012 09:42 AM
[Tool/Web/Other] Cross Functions V1.0 - Create Custom Call Backs / Functions by Just 1 Click CROSS_Hunter Tools and Files 7 05/11/2012 02:17 PM
Two Object functions notepad Scripting Help 2 22/04/2012 04:26 AM


All times are GMT. The time now is 09:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.