ferriswheel fs and streamer
#1

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(
gWheelTransAlternatefModifyWheelZPos 0.05;
    
    
MoveDynamicObjectgFerrisWheelgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2]+fModifyWheelZPos,
                
FERRIS_WHEEL_SPEED0.0gCurrentTargetYAngleFERRIS_WHEEL_Z_ANGLE );
}
//-------------------------------------------------
public OnFilterScriptInit()
{
    
gFerrisWheel CreateDynamicObjectFERRIS_WHEEL_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
    
gFerrisBase CreateDynamicObjectFERRIS_BASE_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
                                   
    new 
x=0;
    while(
!= NUM_FERRIS_CAGES) {
        
gFerrisCages[x] = CreateDynamicObjectFERRIS_CAGE_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
                                   
        
AttachDynamicObjectToObjectgFerrisCages[x], gFerrisWheel,
                              
gFerrisCageOffsets[x][0],
                              
gFerrisCageOffsets[x][1],
                                
gFerrisCageOffsets[x][2],
                              
0.00.0FERRIS_WHEEL_Z_ANGLE+180.0);
                    
        
x++;
    }
    
    
SetTimer("RotateWheel",3*1000,0);
    return 
1;
}
//-------------------------------------------------
public OnFilterScriptExit()
{
    new 
x=0;
    
    
DestroyDynamicObject(gFerrisWheel);
    
DestroyDynamicObject(gFerrisBase);
    
    
x=0;
    while(
!= NUM_FERRIS_CAGES) {
        
DestroyDynamicObject(gFerrisCages[x]);
        
x++;
    }
    return 
1;

Reply
#2

Up. Help please :c
Reply
#3

help
Reply
#4

Are you sure you made timer for that public RotateWheel??
Reply
#5

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Are you sure you made timer for that public RotateWheel??
PHP код:
//
// Used for testing interpolated rotations with MoveObject
// Also used to test AttachObjectToObject
// The other ferris wheel (that actually spins!)
// Located on the opposite peer at LS
//
// SA-MP 0.3d and above
//
// - Kye 2011
//
#include <a_samp>
#include "../include/gl_common.inc" // for PlaySoundForPlayersInRange()
#include <streamer>
#define NUM_FERRIS_CAGES        10
#define FERRIS_WHEEL_ID         18877
#define FERRIS_CAGE_ID          18879
#define FERRIS_BASE_ID          18878
#define FERRIS_DRAW_DISTANCE    300.0
#define FERRIS_WHEEL_SPEED      2.01
#define FERRIS_WHEEL_Z_ANGLE      -90.0 // This is the heading the entire ferris wheel is at (beware of gimbal lock)
new Float:gFerrisOrigin[3] = {389.77344, -2028.5000022.10738};
// Cage offsets for attaching to the main wheel
new Float:gFerrisCageOffsets[NUM_FERRIS_CAGES][3] = {
{
0.06990.0600, -11.7500},
{-
6.9100, -0.0899, -9.5000},
{
11.16000.0000, -3.6300},
{-
11.1600, -0.03993.6499},
{-
6.9100, -0.08999.4799},
{
0.06990.060011.7500},
{
6.95990.0100, -9.5000},
{-
11.1600, -0.0399, -3.6300},
{
11.16000.00003.6499},
{
7.0399, -0.02009.3600}
};
// SA-MP objects
new gFerrisWheel;
new 
gFerrisBase;
new 
gFerrisCages[NUM_FERRIS_CAGES];
forward RotateWheel();
//-------------------------------------------------
new Float:gCurrentTargetYAngle 0.0// Angle of the Y axis of the wheel to rotate to.
new gWheelTransAlternate 0// Since MoveObject requires some translation target to intepolate
                            // rotation, the world pos target is alternated by a small amount.
                            
UpdateWheelTarget()
{
    
gCurrentTargetYAngle += 36.0// There are 10 carts, so 360 / 10
    
if(gCurrentTargetYAngle >= 360.0) {
        
gCurrentTargetYAngle 0.0;
    }
    if(
gWheelTransAlternategWheelTransAlternate 0;
    else 
gWheelTransAlternate 1;
}
//-------------------------------------------------
public RotateWheel()
{
    
UpdateWheelTarget();
    
    new 
Float:fModifyWheelZPos 0.0;
    if(
gWheelTransAlternatefModifyWheelZPos 0.05;
    
    
MoveDynamicObjectgFerrisWheelgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2]+fModifyWheelZPos,
                
FERRIS_WHEEL_SPEED0.0gCurrentTargetYAngleFERRIS_WHEEL_Z_ANGLE );
}
//-------------------------------------------------
public OnFilterScriptInit()
{
    
gFerrisWheel CreateDynamicObjectFERRIS_WHEEL_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
    
gFerrisBase CreateDynamicObjectFERRIS_BASE_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
                                   
    new 
x=0;
    while(
!= NUM_FERRIS_CAGES) {
        
gFerrisCages[x] = CreateDynamicObjectFERRIS_CAGE_IDgFerrisOrigin[0], gFerrisOrigin[1], gFerrisOrigin[2],
                                   
0.00.0FERRIS_WHEEL_Z_ANGLE, -1,-1,-1FERRIS_DRAW_DISTANCE );
                                   
        
AttachDynamicObjectToObjectgFerrisCages[x], gFerrisWheel,
                              
gFerrisCageOffsets[x][0],
                              
gFerrisCageOffsets[x][1],
                                
gFerrisCageOffsets[x][2],
                              
0.00.0FERRIS_WHEEL_Z_ANGLE+180.0);
                    
        
x++;
    }
    
    
SetTimer("RotateWheel",3*1000,0);
    return 
1;
}
//-------------------------------------------------
public OnFilterScriptExit()
{
    new 
x=0;
    
    
DestroyDynamicObject(gFerrisWheel);
    
DestroyDynamicObject(gFerrisBase);
    
    
x=0;
    while(
!= NUM_FERRIS_CAGES) {
        
DestroyDynamicObject(gFerrisCages[x]);
        
x++;
    }
    return 
1;
}
//-------------------------------------------------
public OnObjectMoved(objectid)
{
    if(
objectid != gFerrisWheel) return 0;
    
    
SetTimer("RotateWheel",3*1000,0);
    return 
1;
}
//-------------------------------------------------
public OnPlayerConnect(playerid){
    
RemoveBuildingForPlayer(playerid6463389.7734, -2028.468819.80470.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2028.500032.22660.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2021.640629.92970.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2017.453124.03130.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2017.429716.85160.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2021.632810.98440.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2028.51568.78130.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2035.398410.94530.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2039.640616.84380.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2039.656324.10940.25);
    
RemoveBuildingForPlayer(playerid3751389.8750, -2035.382829.95310.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2039.640616.84380.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2039.656324.10940.25);
    
RemoveBuildingForPlayer(playerid6298389.7734, -2028.468819.80470.25);
    
RemoveBuildingForPlayer(playerid6461389.7734, -2028.500020.10940.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2028.500032.22660.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2021.640629.92970.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2017.453124.03130.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2017.429716.85160.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2021.632810.98440.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2028.51568.78130.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2035.398410.94530.25);
    
RemoveBuildingForPlayer(playerid3752389.8750, -2035.382829.95310.25);
    return 
1;

Reply
#6

BUMP
Reply
#7

sorry, forget about this topic, but anyway . I haven't fund a solution to solve it. UP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)