door wont open
#1

Im making a door open by MoveObject but Instead of the door its moving an other object.
pawn Код:
new islanddoor;
pawn Код:
if (strcmp("/idoor", cmdtext, true, 10) == 0)
    {
        if( !IsPlayerAdmin( playerid ) )
        return SendClientMessage( playerid, 0xFF0000FF, "You are not an Admin!" );
        MoveDynamicObject(islanddoor, 1540.40002441,-3477.19995117,1.50000005, 0.5);
        return 1;
    }
pawn Код:
islanddoor = CreateObject(1495,1540.40002441,-3477.19995117,1.20000005,0.00000000,0.00000000,269.50000000); //object(gen_doorext01) (1)
I want to make it open like a real door.
Reply
#2

What you need is the closed gate coordinations i.e Floats of x, y and z and the opened gate coordinations i.e Floats of x, y and z. Now with the closed gate object you put in the GamemodeInit and MoveObject in the command with OPEN x, y and z coordinations.

You will be needing the following topic for the tutorial.

https://sampforum.blast.hk/showthread.php?tid=43930
-FalconX
Reply
#3

Quote:
Originally Posted by FalconX
Посмотреть сообщение
What you need is the closed gate coordinations i.e Floats of x, y and z and the opened gate coordinations i.e Floats of x, y and z. Now with the closed gate object you put in the GamemodeInit and MoveObject in the command with OPEN x, y and z coordinations.

You will be needing the following topic for the tutorial.

https://sampforum.blast.hk/showthread.php?tid=43930
-FalconX
let me get the opened and closed one wait.
Reply
#4

how can I make it to rotate? thats what I want
Reply
#5

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
how can I make it to rotate? thats what I want
The rotate float x, y, z are optional. Anyway if you want to rotate you can also get the Rx, Ry and Rz by using MTA Map Editor, I am not sure about other map editors. Just click the object, you will see the info about it and first take screenshot of opened door it's coordinations with rotation. And do the same with closed door.

What map editor you are using?

-FalconX
Reply
#6

CreateDynamicObject(1495,1540.40002441,-3477.19995117,1.20000005,0.00000000,0.00000000,269 .50000000); CLOSED

OPEN
CreateDynamicObject(1495, 1540.40002441,-3477.19995117,1.20000005,0.00000000,0.00000000,348 .00000000);

MTA 1.3
Reply
#7

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
CreateDynamicObject(1495,1540.40002441,-3477.19995117,1.20000005,0.00000000,0.00000000,269 .50000000); CLOSED

OPEN
CreateDynamicObject(1495, 1540.40002441,-3477.19995117,1.20000005,0.00000000,0.00000000,348 .00000000);

MTA 1.3
EDIT: nvm I forgot that you are using MoveDynamicObject lol, Okay so do the same I said above. Try this:-

You have used 7 parameters where there are 8 please recheck.

pawn Код:
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0);
with

pawn Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
-FalconX
Reply
#8

How can I make it please im new.

the door is just going down only not opening like a real door.
Reply
#9

Quote:
Originally Posted by oscar7610
Посмотреть сообщение
How can I make it please im new.

the door is just going down only not opening like a real door.
Okay, try the following:-

On top
pawn Код:
new Door; // for door object
new IsDoorOpened; // to check if the door is open
Now the following in OnGamemodeInit or FilterScriptInit as you like.

pawn Код:
Door = CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0); // the object is created.
Now in your command use like the following.

pawn Код:
if(!strcmp("/idoor", cmdtext, true, 6))
{
    if(IsDoorOpened == 0) // means: if not opened it will open
    {
        SendClientMessage(playerid, -1, "Door: The door is now opened");
        IsDoorOpened = 1;
        MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0); // open the door x, y, z etc
    }
    else // else if the gate is open it will close
    {
        SendClientMessage(playerid, -1, "Door: The door is now closed");
        IsDoorOpened = 0;
        MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0); // close door x, y ,z
    }
    return 1 ;
}
Reply
#10

Quote:
Originally Posted by FalconX
Посмотреть сообщение
Okay, try the following:-

On top
pawn Код:
new Door; // for door object
new IsDoorOpened; // to check if the door is open
Now the following in OnGamemodeInit or FilterScriptInit as you like.

pawn Код:
Door = CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0); // the object is created.
Now in your command use like the following.

pawn Код:
if(!strcmp("/idoor", cmdtext, true, 6))
{
    if(IsDoorOpened == 0) // means: if not opened it will open
    {
        IsDoorOpened = 1;
        MoveDynamicObject(Door, Float:x, Float:y, Float:z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0); // open the door x, y, z etc
    }
    else // else if the gate is open it will close
    {
        IsDoorOpened = 0
        MoveDynamicObject(Door, Float:x, Float:y, Float:z, Float:speed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0); // close door x, y ,z
    }
    return 1 ;
}
thanks reped +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)