turn pirate ship
#1

hello

my english isn't good i hope you can understand :P
i'm making a script for the pirate ship
i wan't to turn it and then go forward in the turned position.
i've made this
Код:
	if(strcmp(cmdtext,"/forward1",true)==0)
		{
		if(GetObjectRot(schip,RotX,RotY,RotZ)==0)
 		GetObjectPos(schip, x, y, z);
		MoveObject(schip, x, y+99999, z, 3);
		if(GetObjectRot(schip,RotX,RotY,RotZ)==45)
 		GetObjectPos(schip, x, y, z);
		MoveObject(schip, x-99999, y+99999, z, 3);
		if(GetObjectRot(schip,RotX,RotY,RotZ)==90)
 		GetObjectPos(schip, x, y, z);
		MoveObject(schip, x-99999, y, z, 3);
		if(GetObjectRot(schip,RotX,RotY,RotZ)==135)
 		GetObjectPos(schip, x, y, z);
		MoveObject(schip, x+99999, y-99999, z, 3);
		if(GetObjectRot(schip,RotX,RotY,RotZ)==180)
 		GetObjectPos(schip, x, y, z);
		MoveObject(schip, x, y-99999, z, 3);
		return 1;
	}
but the ==0 must be for RotZ
i think that the code isn't good
only if RotZ is 0 or 45 or 90 the ship has to go forward

i hope you understand my question

grz
Reply
#2

if(GetObjectRot(schip,RotX,RotY,RotZ)==0)

Makes no sense.

If you want to check if RotZ == 0, you need:

pawn Код:
GetObjectRot(schip,RotX,RotY,RotZ);
if(RotZ == 0)
   {
   // stuff
   }
Reply
#3

Quote:
Originally Posted by Weirdosport
if(GetObjectRot(schip,RotX,RotY,RotZ)==0)

Makes no sense.

If you want to check if RotZ == 0, you need:

pawn Код:
GetObjectRot(schip,RotX,RotY,RotZ);
if(RotZ == 0)
  {
  // stuff
  }
Rotations are floats?
Reply
#4

Yes... Check wiki

Here is params from wiki if you do not trust me:
Quote:

GetObjectRot

Parameters:
(objectid, &Float:RotX, &Float:RotY, &Float:RotZ)

Reply
#5

ok thanx i will try
Reply
#6

what i did is attached that ship to a vehicle, simply with attachobject to player, and onplayervehicle enter
en onplayervehicleexit

trust me this is fun, i made it cuz ma brotha showed me a vid on ******* where they had that aswell
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)