warning 213: tag mismatch
gInfo[gateid][dif] = floatsub(gInfo[gateid][newRZ],gInfo[gateid][oldRZ]);
RotateObject(gInfo[gid][gObj],gInfo[gid][oldRX],gInfo[gid][oldRY],gInfo[gid][oldRZ],gInfo[gid][dif],gInfo[gid][rSpeed]);
enum oInfo
{
bool:Exist,
ModelID,
gObj,
Float:oldX, //Created X
Float:oldY, //Created Y
Float:oldZ, //Created Z
Float:newX, //X Pos after moving
Float:newY, //Y Pos after moving
Float:newZ, //Z Pos after moving
Float:oldRX, // Created rotation X
Float:oldRY, //Created rotation Y
Float:oldRZ, //Created rotation Z
Float:newRX, //Rotation X after moving
Float:newRY, //Rotation Y after moving
Float:newRZ, //Rotation Z after moving
Radius,//Distance/radius to open automatically
mSpeed, //Movement speed
rSpeed, //Rotation speed
Float:dif // Substracing later
}
new gInfo[MAX_SERVER_GATES][oInfo];
stock AddMoveableObject(modelid,Float:CX,Float:CY,Float:CZ,Float:OX,Float:OY,Float:OZ,Float:CrX,Float:CrY,Float:CrZ,Float:OrX,Float:OrY,Float:OrZ,Radius2,MovingSpeed,RotatingSpeed)
{
gCount++;
gateid = gCount;
if(gTimer == -1) gTimer = SetTimer("WhatEver",10,true);
gInfo[gateid][Exist] = true;
gInfo[gateid][ModelID] = modelid;
gInfo[gateid][oldX] = CX;
gInfo[gateid][oldY] = CY;
gInfo[gateid][oldZ] = CZ;
gInfo[gateid][newX] = OX;
gInfo[gateid][newY] = OY;
gInfo[gateid][newZ] = OZ;
gInfo[gateid][oldRX] = CrX;
gInfo[gateid][oldRY] = CrY;
gInfo[gateid][oldRZ] = CrZ;
gInfo[gateid][newRX] = OrX;
gInfo[gateid][newRY] = OrY;
gInfo[gateid][newRZ] = OrZ;
gInfo[gateid][Radius] = Radius2;
gInfo[gateid][mSpeed] = MovingSpeed;
gInfo[gateid][rSpeed] = RotatingSpeed;
gInfo[gateid][gObj] = CreateObject(modelid,CX,CY,CZ,CrX,CrY,CrZ);
gInfo[gateid][dif] = floatsub(gInfo[gateid][newRZ],gInfo[gateid][oldRZ]);
return true;
}
#include <a_samp>
enum oInfo
{
bool:Exist,
ModelID,
gObj,
Float:oldX, //Created X
Float:oldY, //Created Y
Float:oldZ, //Created Z
Float:newX, //X Pos after moving
Float:newY, //Y Pos after moving
Float:newZ, //Z Pos after moving
Float:oldRX, // Created rotation X
Float:oldRY, //Created rotation Y
Float:oldRZ, //Created rotation Z
Float:newRX, //Rotation X after moving
Float:newRY, //Rotation Y after moving
Float:newRZ, //Rotation Z after moving
Radius,//Distance/radius to open automatically
mSpeed, //Movement speed
rSpeed, //Rotation speed
Float:dif // Substracing later
}
new gInfo[10][oInfo];
main()
{
new gateid = 1;
gInfo[gateid][dif] = floatsub(gInfo[gateid][newRZ],gInfo[gateid][oldRZ]);
}
Actually the code is in the RotateObject line,but I am sending you the code right now.
|
No no,you got me wrong,the RotateObject function is absolutely fine,it's in one of the includes I use,the problem is in the specific combination of RotateObject and gInfo[gateid][dif],for example if I'd take the number 3 and position it instead of gInfo[gateid][dif],everything would be fine,but I really need the subtracted result for the rotation to be smooth.
|
RotateObject(gInfo[gid][gObj],gInfo[gid][oldRX],gInfo[gid][oldRY],gInfo[gid][oldRZ],floatround(gInfo[gid][dif]),gInfo[gid][rSpeed]);