Something wrong with a gate
#1

Right, when I do this, it returns with a message I created, wrongly of course.

It says: "This gate is pretty much fucked up."

If you know what's wrong in this piece of code, please tell me as fast as possible, thankyou.


pawn Код:
new FBIGate1, FBIGate2, FBIGate = 0;

else if(IsPlayerInRangeOfPoint(playerid, 20, 1031.2998047, 1162.7998047, 11.5000000))
        {
            new string[156];
            if(Player[playerid][Faction] == 10)
            {
                if(FBIGate == 0)
                {
                    MoveDynamicObject(FBIGate1, 1031.2998047, 1162.7998047, 11.5000000, 2.0);
                    MoveDynamicObject(FBIGate2, 1023.4000244, 1162.8000488, 11.5000000, 2.0);
                    format(string, sizeof(string), "%s has pressed on his remote-control and has opened the gates.");
                    SetPlayerChatBubble(playerid, string, ACTION, 10.0, 1000*10);
                    FBIGate = 1;
                }
                else
                {
                    MoveDynamicObject(FBIGate1, 1039.1999512, 1162.8000488, 11.5000000, 2.0);
                    MoveDynamicObject(FBIGate2, 1015.2999878, 1162.8000488, 11.5000000, 2.0);
                    format(string, sizeof(string), "%s has pressed on his remove-control and has closed the gates.");
                    SetPlayerChatBubble(playerid, string, ACTION, 10.0, 1000*10);
                    FBIGate = 0;
                }
                SendClientMessage(playerid, GREY, "This gate is pretty much fucked up.");
            }
        }
        else return SendClientMessage(playerid, GREY, "You are not in range of a gate.");


        FBIGate1 = CreateDynamicObject(985,1031.2998047,1162.7998047,11.5000000,0.0000000,0.0000000,0.0000000); //object(gate_autor)(1)
        FBIGate2 = CreateDynamicObject(986,1023.4000244,1162.8000488,11.5000000,0.0000000,0.0000000,0.0000000); //object(gate_autol)(1)
Reply
#2

pawn Код:
SendClientMessage(playerid, GREY, "This gate is pretty much fucked up.");
That message will show always when player is in range of point, and faction is 10. Either add return clauses the if/else above it, or simply remove that line.
Reply
#3

pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 20, 1031.2998047, 1162.7998047, 11.5000000))
        {
            new string[156];
            if(Player[playerid][Faction] == 10)
            {
                /*if(FBIGate == 0)
                {
                    MoveDynamicObject(FBIGate1, 1031.2998047, 1162.7998047, 11.5000000, 2.0);
                    MoveDynamicObject(FBIGate2, 1023.4000244, 1162.8000488, 11.5000000, 2.0);
                    format(string, sizeof(string), "%s has pressed on his remote-control and has opened the gates.");
                    SetPlayerChatBubble(playerid, string, ACTION, 10.0, 1000*10);
                    FBIGate = 1;
                }
                else
                {
                    MoveDynamicObject(FBIGate1, 1039.1999512, 1162.8000488, 11.5000000, 2.0);
                    MoveDynamicObject(FBIGate2, 1015.2999878, 1162.8000488, 11.5000000, 2.0);
                    format(string, sizeof(string), "%s has pressed on his remove-control and has closed the gates.");
                    SetPlayerChatBubble(playerid, string, ACTION, 10.0, 1000*10);
                    FBIGate = 0;
                }*/

                SendClientMessage(playerid, GREY, "This gate is pretty much fucked up.");
            }
        }
        else return SendClientMessage(playerid, GREY, "You are not in range of a gate.");


        FBIGate1 = CreateDynamicObject(985,1031.2998047,1162.7998047,11.5000000,0.0000000,0.0000000,0.0000000); //object(gate_autor)(1)
        FBIGate2 = CreateDynamicObject(986,1023.4000244,1162.8000488,11.5000000,0.0000000,0.0000000,0.0000000); //object(gate_autol)(1)
Do you understand it now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)