Object rotating - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Object rotating (
/showthread.php?tid=270253)
Object rotating -
Daslee - 19.07.2011
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?
Re: Object rotating -
XGh0stz - 19.07.2011
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)
Re: Object rotating -
Daslee - 19.07.2011
Ok, i'll try.