Object rotating
#1

Hello. Im trying to make a car paking place in my server, but using SetObjectRot i have problem. I have added object for gates, and i want to make them open by rotating. So the problem is that, when SetObjectRot don't doing anything, don't rotates object. There are my codes:

I have this codes on gamemode init:

Код:
new aikstelesv;
aikstelesv = CreateObject(968, -1970.6625976563, 277.96701049805, 35.209579467773, 359.94348144531, 268.00082397461, 359.9990234375);
Then on player pickup pikcup:

Код:
ShowPlayerDialog(playerid,8638,DIALOG_STYLE_MSGBOX,"Car Parking","Gates opening price is: 150$\nDo you want to open?","Yes","No");
And then on dialogresponse:

Код:
if(dialogid == 8638)
{
	if(response)
	{
	    if(GetPlayerMoneyA(playerid) < 150)
	    {
	        SendClientMessage(playerid,BLUE,"Sorry, but you don't have 150$");
	        return 1;
	    }
	    GivePlayerMoneyA(playerid, -150);
	    MoveObject(aikstelesv,-1970.662109375, 277.966796875, 35.209579467773, 3);
	    SetObjectRot(aikstelesv,1.7361450195313, 357.99905395508, 358.31900024414); //Cordinates not of object x,y,z position, but x,y,z rotation ;p
	    return 1;
	}
}
And i can't see where is the problem, why it don't rotates object?
Reply
#2

Make sure the script makes it all the way to SetObjectRot which it probably does, this'll be easy, You'll be -$150.
The X Y & Z Rotations are diffirent than MTA Map Editor or least for what I remember, so experientment a bit:
(Assuming you used MTA to map your object)

Код:
SetObjectRot(aikstelesv,180.7361450195313, 0.0, 0.0);
For example, see what that might do to the object

I do remember having a problem back in 0.2a with rotating objects because the function just didnt work properly
But keep messing around with the diffirent X, Y & Z Settings to see if that at least rotates the object at all

ALSO: There are global objects & there are player objects, make sure you're using the right functions to rotate the target object. For example, you cant move a player object by rotating a global object (Just a note)
Reply
#3

Ok, i'll try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)