28.11.2016, 19:39
Hi all. I wanted to add ferriswheel filterscript to my server. it works perfectly. Now, i decided to make it work with streamer plugin. Thats the part, where i changed the code. As result - wheel isn't moving. anymore. whats wrong with it?
PHP код:
public RotateWheel()
{
UpdateWheelTarget();
new Float:fModifyWheelZPos = 0.0;
if(gWheelTransAlternate) fModifyWheelZPos = 0.05;
MoveDynamicObject( gFerrisWheel, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2]+fModifyWheelZPos,
FERRIS_WHEEL_SPEED, 0.0, gCurrentTargetYAngle, FERRIS_WHEEL_Z_ANGLE );
}
//-------------------------------------------------
public OnFilterScriptInit()
{
gFerrisWheel = CreateDynamicObject( FERRIS_WHEEL_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, -1,-1,-1, FERRIS_DRAW_DISTANCE );
gFerrisBase = CreateDynamicObject( FERRIS_BASE_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, -1,-1,-1, FERRIS_DRAW_DISTANCE );
new x=0;
while(x != NUM_FERRIS_CAGES) {
gFerrisCages[x] = CreateDynamicObject( FERRIS_CAGE_ID, gFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
0.0, 0.0, FERRIS_WHEEL_Z_ANGLE, -1,-1,-1, FERRIS_DRAW_DISTANCE );
AttachDynamicObjectToObject( gFerrisCages[x], gFerrisWheel,
gFerrisCageOffsets[x][0],
gFerrisCageOffsets[x][1],
gFerrisCageOffsets[x][2],
0.0, 0.0, FERRIS_WHEEL_Z_ANGLE+180.0, 0 );
x++;
}
SetTimer("RotateWheel",3*1000,0);
return 1;
}
//-------------------------------------------------
public OnFilterScriptExit()
{
new x=0;
DestroyDynamicObject(gFerrisWheel);
DestroyDynamicObject(gFerrisBase);
x=0;
while(x != NUM_FERRIS_CAGES) {
DestroyDynamicObject(gFerrisCages[x]);
x++;
}
return 1;
}