07.10.2014, 09:25
(
Последний раз редактировалось Rudy_; 07.10.2014 в 10:24.
)
Hello everyone. Well i need a bit of help,Get Attached Object Pos this actually confused me.
I created an player object [Prop] and attached it to a player, i want to Get the attached object position and whenever a player joins or when ever the object is attached, i want to create the same object [Prop] for the specific player who joined and only he can see it. Like when i attach an object, create the same object for every other player that is connected/ or connects later and Get the object[ prop] position and set the new object position (which i created for every other player) to the Prop object position.
It really confused me, Can this in anyway help me?
I created an player object [Prop] and attached it to a player, i want to Get the attached object position and whenever a player joins or when ever the object is attached, i want to create the same object [Prop] for the specific player who joined and only he can see it. Like when i attach an object, create the same object for every other player that is connected/ or connects later and Get the object[ prop] position and set the new object position (which i created for every other player) to the Prop object position.
It really confused me, Can this in anyway help me?
pawn Код:
stock GetAttachedObjectPos(objectid, Float:offset_x, Float:offset_y, Float:offset_z, &Float:x, &Float:y, &Float:z)
{
new Float:object_px,
Float:object_py,
Float:object_pz,
Float:object_rx,
Float:object_ry,
Float:object_rz;
GetObjectPos(objectid, object_px, object_py, object_pz);
GetObjectRot(objectid, object_rx, object_ry, object_rz);
new Float:cos_x = floatcos(object_rx, degrees),
Float:cos_y = floatcos(object_ry, degrees),
Float:cos_z = floatcos(object_rz, degrees),
Float:sin_x = floatsin(object_rx, degrees),
Float:sin_y = floatsin(object_ry, degrees),
Float:sin_z = floatsin(object_rz, degrees);
x = object_px + offset_x * cos_y * cos_z - offset_x * sin_x * sin_y * sin_z - offset_y * cos_x * sin_z + offset_z * sin_y * cos_z + offset_z * sin_x * cos_y * sin_z;
y = object_py + offset_x * cos_y * sin_z + offset_x * sin_x * sin_y * cos_z + offset_y * cos_x * cos_z + offset_z * sin_y * sin_z - offset_z * sin_x * cos_y * cos_z;
z = object_pz - offset_x * cos_x * sin_y + offset_y * sin_x + offset_z * cos_x * cos_y;
}