SA-MP Forums Archive
Hmm first time saw smthing like this... Pls help me out. +rep - 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: Hmm first time saw smthing like this... Pls help me out. +rep (/showthread.php?tid=326125)



Hmm first time saw smthing like this... Pls help me out. +rep - Scrillex - 16.03.2012

error 003: declaration of a local variable must appear in a compound block
error 010: invalid function or declaration
error 010: invalid function or declaration
fatal error 107: too many error messages on one line

Код:
Float:DistanceCameraTargetToLocation(Float:CamX, Float:CamY, Float:CamZ, Float:ObjX, Float:ObjY, Float:ObjZ, Float:FrX, Float:FrY, Float:FrZ) // error line

	new Float:TGTDistance;//error line
	TGTDistance = floatsqroot((CamX - ObjX) * (CamX - ObjX) + (CamY - ObjY) * (CamY - ObjY) + (CamZ - ObjZ) * (CamZ - ObjZ));
	new Float:tmpX, Float:tmpY, Float:tmpZ;
	tmpX = FrX * TGTDistance + CamX;
	tmpY = FrY * TGTDistance + CamY;
	tmpZ = FrZ * TGTDistance + CamZ;
	return floatsqroot((tmpX - ObjX) * (tmpX - ObjX) + (tmpY - ObjY) * (tmpY - ObjY) + (tmpZ - ObjZ) * (tmpZ - ObjZ));
}



Re: Hmm first time saw smthing like this... Pls help me out. +rep - Twisted_Insane - 16.03.2012

Didn't you forgot the opening bracket?


Re: Hmm first time saw smthing like this... Pls help me out. +rep - Scrillex - 16.03.2012

Oh yeh thanks mate Didn't saw that coming + rep Ahh it show I gave you + rep


Re: Hmm first time saw smthing like this... Pls help me out. +rep - Twisted_Insane - 16.03.2012

Lol, glad I could help! What doesn't show?