Needing Help at Object rotation
#1

Hey guys I got a problem with my Object rotating script.
I wanted to make this object rotating on rotZ 360 degrees constantly but it aint working.
So im asking you if you maybe know what mistake i made in this script:

Quote:

#include <a_samp>

#define FILTERSCRIPT


new TurnTimer;

new obj1;

public OnFilterScriptInit()
{
TurnTimer = SetTimer("LT",10000,1);

obj1 = CreateObject(1697, 1412.40, 1612.52, 29.73, -30.00, 4.50, 0);
return 1;
}

forward LT(playerid);
public LT(playerid)
{
MoveObject(obj1,1412.40, 1612.52, 29.73,2.00, -30.00, 4.50, 0+359.9);
//MoveObject(objectid,X, Y, Z, SPEED , rotX , rotY , rotZ);
}

public OnFilterScriptExit()
{
KillTimer(TurnTimer);
DestroyObject(obj1);
return 1;
}

I get no Errors at compiling but the object itself is not even shown ingame.
So whats the problem ??

ps.
The object is located at LV Airport.
Reply
#2

TurnTimer = SetTimer("LT",10000,0);
Reply
#3

This isnt working for me.
Does someone else know what might be wrong ?
Reply
#4

Why is there a 'playerid' parameter?
pawn Код:
forward LT(playerid);
public LT(playerid)
Change it to:
pawn Код:
forward LT();
public LT()
EDIT: Also, to avoid any conflict with objects, try putting all objects into your gamemode.
Reply
#5

Quote:

This function can be used to make objects rotate smoothly. In order to achieve this however, the object must also be moved.

source: https://sampwiki.blast.hk/wiki/MoveObject

You need to move even if it's just 0.001 in x or y or z to make it visible rotating. When you just change the rotation you can't see the object rotating unless it moves a bit.
So in the part of move object add 0.001 in x, y or z.
Reply
#6

Solved the problem by myself
Silly me didnt setted the Timer xD

public OnFilterScriptInit()
{

TurnTimer = SetTimer("LT",1000,0);
SetTimer("LT",1000,1);

...
What for this was you gonna see in the later existing unique server

Anyway thanks for help

Quote:

EDIT: Also, to avoid any conflict with objects, try putting all objects into your gamemode.

i putted it into a filterscript firstly to get it working properly then i gonna add the working one to the gm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)