problem with moveobject
#1

for some reason the object wont move :/

pawn Код:
new door;
new bool:Door;
new moving;
//in on filterscriptinit
     door = CreateObject(3113, -2305.1000976563, 2050, 0.9200000166893, 0, 0, 0);//door
//in onplayercommandtext
    if (strcmp(cmdtext, "/door", true)==0){
        if(moving != 3){
            if(Door == true){
                MoveObject(door, -2305.1000976563, 2050.0000, 0.9200000166893, 2.00 );
                Door = false;
            }else{
                MoveObject(door, -2305.1000976563, 2050.0000, 10.920000076294, 2.00 );
                Door = true;
            }
            moving = 3;
        }else SendClientMessage(playerid, 0xAAAAAAAA, "The lift is already moving");
        return 1;
    }
//in onobjectmoved
    if(moving != 0){moving = 0;}
Reply
#2

no ideas what is wrong?
Reply
#3

bump...

can anyone help me?
Reply
#4

Pay more attention, you had put the same Z coord. of the object without moving :

door = CreateObject(3113, -2305.1000976563, 2050, 0.9200000166893, 0, 0, 0);
-> MoveObject(door, -2305.1000976563, 2050.0000, 0.9200000166893, 2.00 );


Reply
#5

Oh, and don't triple post... Double posting is against the rules to the best of my knowledge..
Reply
#6

Quote:
Originally Posted by Hot
Pay more attention, you had put the same Z coord. of the object without moving :

door = CreateObject(3113, -2305.1000976563, 2050, 0.9200000166893, 0, 0, 0);
-> MoveObject(door, -2305.1000976563, 2050.0000, 0.9200000166893, 2.00 );


that isnt the problem.. if it was then the object would move the second time i typed /door which it doesnt also i set door = false on init so again that isnt the problem

Quote:

Oh, and don't triple post... Double posting is against the rules to the best of my knowledge..

i tripple posted because i went onto the 3rd page twice and i would really like to get some help with this, how about you dont post if you cannot help me instead of spamming to raise your post count
Reply
#7

Quote:
Originally Posted by jonesy
i tripple posted because i went onto the 3rd page twice and i would really like to get some help with this, how about you dont post if you cannot help me instead of spamming to raise your post count
Accusing me of trying to increase my post count after triple posting makes you look a bit silly..

Try this.

pawn Код:
#include <a_samp>

new
    Door, DoorOpen; //DoorOpen - 0 = closed, 1 = open, 2 = closing, 3 = opening,

public OnFilterScriptInit()
{
    Door = CreateObject(3113, -2305.1000976563, 2050, 0.9200000166893, 0, 0, 0);//door
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/door", true)==0)
    {
        switch(DoorOpen)
        {
            case 1: //If open, close it
            {
                MoveObject(Door, -2305.1000976563, 2050.0000, 0.9200000166893, 2.00 );
                Door = 2;
            }
            case 0: //If closed, open it
            {
                MoveObject(Door, -2305.1000976563, 2050.0000, 10.920000076294, 2.00 );
                Door = 3;
            }
            case 2,3: //If moving, tell the player.
            {
              SendClientMessage(playerid, 0xAAAAAAAA, "The lift is already moving");
            }
        }
        return 1;
    }
    return 0;
}

public OnObjectMoved(objectid)
{
    if(objectid == Door)
    {
        switch(DoorOpen)
        {
            case 2: DoorOpen = 0;
            case 3: DoorOpen = 1;
        }
    }
    return 1;
}
Reply
#8

I don't really see how changing it to a switch statement will change anything I have two other objects (the lifts on the aircraft carrier) that I have done in basically the exact same way and they work fine however the door refuses to work

Also I have explained that I only triple posted in order to bump this from the third page and not to increase my own post count so stop with the kind of attitude that has given this forum pretty much a bad reputation, it is not helping anyone and only serves to prove the fact that you are an arrogant little ****.

Also I tried adding another object to the FS and found that when I use the /door command it moved the 4th object instead of the one that I have defined as door in the FS which I found kind of wierd
Reply
#9

You can call me an arrogant little **** all you like, that script is better than yours and it works, I tested it...
Reply
#10

Quote:
Originally Posted by Weirdosport
Oh, and don't triple post... Double posting is against the rules to the best of my knowledge..
You aren't a moderator so don't try and do their job. if you're going to post in this topic, help jonesy with his code, otherwise, get off this topic mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)