SA-MP Forums Archive
Bug with the moving object[++rep!] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bug with the moving object[++rep!] (/showthread.php?tid=322005)



Bug with the moving object[++rep!] - Chris_Morrison - 29.02.2012

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:

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!


Re: Bug with the moving object[++rep!] - parames3010 - 29.02.2012

You Test Use Plugins : Streamer And Object : DynamicObject Working !! ^^


Re: Bug with the moving object[++rep!] - Chris_Morrison - 29.02.2012

I don't understand you what you meant?


Re: Bug with the moving object[++rep!] - Chris_Morrison - 29.02.2012

Helppppppp


Re: Bug with the moving object[++rep!] - nuriel8833 - 29.02.2012

I need to see the /closedoor and /opendoor functions in order to fix this.


Re: Bug with the moving object[++rep!] - SomebodyAndMe - 29.02.2012

Could u post the codes?


Re: Bug with the moving object[++rep!] - Chris_Morrison - 29.02.2012

Sure i can whatever you need to fix this shit!
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;
    }



Re: Bug with the moving object[++rep!] - Chris_Morrison - 29.02.2012

Help please!


Re: Bug with the moving object[++rep!] - arathin - 29.02.2012

It seems to me like you have the rotation correct when you type /open but the coordinates to where it moves it is incorrect I would suggest trying to get the coordinates for the side of the door way and try that.


Re: Bug with the moving object[++rep!] - arathin - 29.02.2012

Quote:
Originally Posted by arathin
Посмотреть сообщение
It seems to me like you have the rotation correct when you type /open but the coordinates to where it moves it is incorrect I would suggest trying to get the coordinates for the side of the door way and try that.
Okay I know that I posted just recently but I noticed something. In the picture when you type close door it isn't rotating the door back to how it was before it was open its just sliding it back to the coordinates of it as a closed door so you need to find a way to have it rotate back to that position exactly. Other than that just do what I told you in the quote above.