setting object rot
#1

pawn Код:
SetPVarFloat(playerid, "GPS_X", 2680.8572);
        SetPVarFloat(playerid, "GPS_Y", -1330.0626);
        SetPVarFloat(playerid, "GPS_Z", 42.8088);
       
        GPS_OBJ = CreateObject(1318, 0, 0, 0, 0, 0, 0);
       
        new vehid = GetPlayerVehicleID(playerid);
       
        AttachObjectToVehicle(GPS_OBJ, vehid, 0.0, 0.0, 1.0, 0, 0, 0);
pawn Код:
SetObjectRot(GPS_OBJ,GetPVarFloat(playerid, "GPS_X"),GetPVarFloat(playerid, "GPS_Y"),GetPVarFloat(playerid, "GPS_Z"));
I have this, but it doesn't set object rot
Reply
#2

anyone?
Reply
#3

Lol, Read the SetObjectRot Function...
SetObjectRot(Object,X,Y,Z);
Reply
#4

Quote:
Originally Posted by [UG]Scripter
Посмотреть сообщение
Lol, Read the SetObjectRot Function...
SetObjectRot(Object,X,Y,Z);
Read again, i am doing the same thing.
I see that you're not understanding the line
Reply
#5

Without looking at the rest of your script, its difficult for me to understand why you are using PVars for a function that is dealing with vehicle id's and object id's.

You set PVars with what I assume are rotation values
You create an object
You attach the object to a vehicle, which includes rotation values of 0, 0, 0
You set the rotation of the attached object with the values of the previously defined PVars

Why don't you just put the rotation values in the attach object command?

also, try 0.0, 0.0, 0.0 instead of 0, 0, 0 ( worth a try, sometimes it matters )

[edit] Considering object rotation is included in the Attach command, it is quite possible that you simply can't set the rotation of an attached object. Someone who is more familiar with 0.3c may be able to confirm this
Reply
#6

I'm trying to make something like this ( see attachment)

the arrow is a object ( ID: 1318 )

So if i can't set object's rotation if it's attached, then i will have to destroy, create, attach and like that all the time. (under 1 sec timer)

pawn Код:
if(GetPVarInt(playerid, "GPS") > 0)
        {
               DestroyObject(GPS_OBJ);
               GPS_OBJ = CreateObject( 1318, 0, 0, 0, 0, 0, 0);

               new vehid = GetPlayerVehicleID(playerid);

               AttachObjectToVehicle(GPS_OBJ, vehid, 0.0, 0.0, 1.5, 2680.8572, -1330.0626, 42.8088);


           
        }
But it doesnt work, because it doesnt change arrow's rotation
Reply
#7

anyone?
Reply
#8

bump
Reply
#9

you know rotation is in degrees? and 360 degrees is the same as zero?
your rotation values are 2680.8572, -1330.0626, 42.8088?
Reply
#10

Код:
Float:fRotX, Float:fRotY, Float:RotZ - Last 3 arguments
It's not in degrees? is it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)