Bug with the moving object[++rep!]
#1

Hello
I have a big bug with the moving object
first,This object must move fine and it's fucked up(i had this mode before and all worked just fine)
I tried to do one myself to take the /opendoor command from other gamemodes and it's won't work!
Screens:
Before /oepndoor and /closedoor:

/opendoor:

/closedoor:

the code:
pawn Код:
if(strcmp(cmd, "/opendoor", true) == 0 || strcmp(cmd, "/od", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid) || IsASheriff(playerid))
            {
        if(PlayerToPoint(2, playerid,239.649917,117.577560,1003.218688) && IsACop(playerid))
                {
                    MoveObject(pdd1, 239.5, 120.09999847412, 1003.4000244141,1); // V
                }
                else if(PlayerToPoint(2, playerid,253.191696,109.082427,1003.225708))
                {
                    MoveObject(pdd2, 253, 111.19999694824, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.207733,125.242126,1003.218750))
                {
                    MoveObject(pdd3, 253, 123.30000305176, 1003.4000244141,1); //V
                }
                else if(PlayerToPoint(2, playerid,232.931304,109.093315,1010.208679) && IsACop(playerid))//d.chief
                {
                    if(PlayerInfo[playerid][pRank] >= 9)
                    {
                        MoveObject(pdddc, 232.69999694824, 111.19999694824, 1010.700012207,1);
                    }
                    else
                    {
                    SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
                    return 1;
                    }
                }
                else if(PlayerToPoint(2, playerid, 231.135330,119.553451,1010.218750) && IsACop(playerid))//chief
                {
                    if(PlayerInfo[playerid][pRank] >= 9)
                    {
                        MoveObject(pddc,229.10000610352, 119.40000152588, 1010.5999755859,1);
                    }
                    else
                    {
                    SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
                    return 1;
                    }
                }
                else if(PlayerToPoint(2, playerid,275.642517,117.420158,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd4, 275.542517,119.420158,1004.617187,1);
                }
                else if(PlayerToPoint(2, playerid,265.835815,112.502014,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd5, 263.70001220703, 112.69999694824, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,265.989532,115.889060,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd6, 268.20001220703, 116.09999847412, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,239.628219,125.069351,1003.218750) && IsACop(playerid))
                {
                    MoveObject(pdd7, 239.80000305176, 122.90000152588, 1003.4000244141,1);
                }
                else
                {
                SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
                return 1;
                }
                format(string, sizeof(string), "* %s types the access code **** while covering with his free hand.", sendername);
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");}
        }
        return 1;
    }
    if(strcmp(cmd, "/closedoor", true) == 0 || strcmp(cmd, "/cd", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid) || IsASheriff(playerid))
            {
           if(PlayerToPoint(2, playerid,239.5, 117.59999847412, 1003.4000244141))
                {
                        MoveObject(pdd1, 239.5, 117.59999847412, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.19999694824, 109.09999847412, 1003.4000244141))
                {
                MoveObject(pdd2, 253.19999694824, 109.09999847412, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.30000305176, 125.30000305176, 1003.4000244141))
                {
                    MoveObject(pdd3, 253.30000305176, 125.30000305176, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,232.80000305176, 109.09999847412, 1010.4000244141))//d.chief
                {
                        MoveObject(pdddc, 232.80000305176, 109.09999847412, 1010.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,231.10000610352, 119.59999847412, 1010.4000244141))//chief
                {
                    MoveObject(pddc, 231.10000610352, 119.59999847412, 1010.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,217.80000305176, 116.5, 999.20001220703))
                {
                    MoveObject(pdd4, 217.80000305176, 116.5, 999.20001220703,1);
                }
                else if(PlayerToPoint(2, playerid,265.70001220703, 112.40000152588, 1004.799987793))
                {
                    MoveObject(pdd5, 265.70001220703, 112.40000152588, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,266, 115.90000152588, 1004.799987793))
                {
                    MoveObject(pdd6, 266, 115.90000152588, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,239.60000610352, 125.09999847412, 1003.4000244141))
                {
                    MoveObject(pdd7, 239.60000610352, 125.09999847412, 1003.4000244141,1);
                }
                else
                {
                SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
                return 1;
                }
                format(string, sizeof(string), "* %s closes the door", sendername);
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");}
        }
        return 1;
    }
What to do?i must work on my mode and i can't without it
I'm sure i did it good i took from other gamemodes i tried all of it!
It's my 2nd thread i'm opening about it i tried every fucking thing and it's won't work i copied from other gamemodes and it's just keep bugged
what to do!!!!!!!!
Reply
#2

The /opendoor command places the door at a wrong position, but sets the right rotation.
The /closedoor command places the door at a good position, but sets the wrong rotation.

I got this information by just observing and good thinking, no knowledge of pawn needed.
I can't help you any further with the information you posted here.
Reply
#3

What you need to help me?just tell me what you need and i will give you i'm tierd
Reply
#4

Quote:
Originally Posted by Chris_Morrison
Посмотреть сообщение
What you need to help me?just tell me what you need and i will give you i'm tierd
I would suggest fixing it yourself. Because if i will do it for you, you will just get stuck on an other command later.
I pushed you in the right direction with my previous post. Just play with the object coordinates a bit.

Search for some tutorials on the forum or read some wiki articles.
Reply
#5

show me all your code you have about this door please i will see if there are some coords wrong XD

EDIT: probably you forgot to rotate it back when doing /closedoor... you probably only have the coords of how it has to stand but not the rotation XD
Reply
#6

Its can't be i took the open and close cmds from other 4 gamemodes so it's can't be something wrong on the coordinates
Reply
#7

without the codes we cant help ya either man
Reply
#8

i think you need to Put the FS Buttons.amx and Try to update the streamer
NOTE : parameter distance renamed to streamdistance
Reply
#9

pawn Код:
if(strcmp(cmd, "/opendoor", true) == 0 || strcmp(cmd, "/od", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid) || IsASheriff(playerid))
            {
        if(PlayerToPoint(2, playerid,239.649917,117.577560,1003.218688) && IsACop(playerid))
                {
                    MoveObject(pdd1, 239.5, 120.09999847412, 1003.4000244141,1); // V
                }
                else if(PlayerToPoint(2, playerid,253.191696,109.082427,1003.225708))
                {
                    MoveObject(pdd2, 253, 111.19999694824, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.207733,125.242126,1003.218750))
                {
                    MoveObject(pdd3, 253, 123.30000305176, 1003.4000244141,1); //V
                }
                else if(PlayerToPoint(2, playerid,232.931304,109.093315,1010.208679) && IsACop(playerid))//d.chief
                {
                    if(PlayerInfo[playerid][pRank] >= 9)
                    {
                        MoveObject(pdddc, 232.69999694824, 111.19999694824, 1010.700012207,1);
                    }
                    else
                    {
                    SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
                    return 1;
                    }
                }
                else if(PlayerToPoint(2, playerid, 231.135330,119.553451,1010.218750) && IsACop(playerid))//chief
                {
                    if(PlayerInfo[playerid][pRank] >= 9)
                    {
                        MoveObject(pddc,229.10000610352, 119.40000152588, 1010.5999755859,1);
                    }
                    else
                    {
                    SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
                    return 1;
                    }
                }
                else if(PlayerToPoint(2, playerid,275.642517,117.420158,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd4, 275.542517,119.420158,1004.617187,1);
                }
                else if(PlayerToPoint(2, playerid,265.835815,112.502014,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd5, 263.70001220703, 112.69999694824, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,265.989532,115.889060,1004.617187) && IsACop(playerid))
                {
                    MoveObject(pdd6, 268.20001220703, 116.09999847412, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,239.628219,125.069351,1003.218750) && IsACop(playerid))
                {
                    MoveObject(pdd7, 239.80000305176, 122.90000152588, 1003.4000244141,1);
                }
                else
                {
                SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
                return 1;
                }
                format(string, sizeof(string), "* %s types the access code **** while covering with his free hand.", sendername);
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");}
        }
        return 1;
    }
    if(strcmp(cmd, "/closedoor", true) == 0 || strcmp(cmd, "/cd", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid) || IsASheriff(playerid))
            {
           if(PlayerToPoint(2, playerid,239.5, 117.59999847412, 1003.4000244141))
                {
                        MoveObject(pdd1, 239.5, 117.59999847412, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.19999694824, 109.09999847412, 1003.4000244141))
                {
                MoveObject(pdd2, 253.19999694824, 109.09999847412, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,253.30000305176, 125.30000305176, 1003.4000244141))
                {
                    MoveObject(pdd3, 253.30000305176, 125.30000305176, 1003.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,232.80000305176, 109.09999847412, 1010.4000244141))//d.chief
                {
                        MoveObject(pdddc, 232.80000305176, 109.09999847412, 1010.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,231.10000610352, 119.59999847412, 1010.4000244141))//chief
                {
                    MoveObject(pddc, 231.10000610352, 119.59999847412, 1010.4000244141,1);
                }
                else if(PlayerToPoint(2, playerid,217.80000305176, 116.5, 999.20001220703))
                {
                    MoveObject(pdd4, 217.80000305176, 116.5, 999.20001220703,1);
                }
                else if(PlayerToPoint(2, playerid,265.70001220703, 112.40000152588, 1004.799987793))
                {
                    MoveObject(pdd5, 265.70001220703, 112.40000152588, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,266, 115.90000152588, 1004.799987793))
                {
                    MoveObject(pdd6, 266, 115.90000152588, 1004.799987793,1);
                }
                else if(PlayerToPoint(2, playerid,239.60000610352, 125.09999847412, 1003.4000244141))
                {
                    MoveObject(pdd7, 239.60000610352, 125.09999847412, 1003.4000244141,1);
                }
                else
                {
                SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
                return 1;
                }
                format(string, sizeof(string), "* %s closes the door", sendername);
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else {SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop!");}
        }
        return 1;
    }
Reply
#10

Quote:
Originally Posted by Chris_Morrison
Посмотреть сообщение
Its can't be i took the open and close cmds from other 4 gamemodes so it's can't be something wrong on the coordinates
https://sampwiki.blast.hk/wiki/MoveObject

You probably copied those from older gamemodes, whereas a simple search would reveal that MoveObject's parameters had changed since 0.3d.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)