[REQ]Movable Gates Command
#1

Hey Guys Its Me Alex again i need some help with the movable gates stuff now i got the open and close gate object i tried my best with the commands and movable object stuff but i cannot do it please can someone help me thanks
the commands i want is

/fbo and when they open it i would like it to say "You have opened the Coast Guard Bay gates please /fbc."
/fbc and when they close it i would like it to say "You have closes the Coast Guard Bay gates."

I Would really appreciate someone to help me out with this

aacgopen = CreateObject (8210,1024.18432617,-2008.80285645,15.24494743,0.00000000,0.00000000,84 .00000000);
sacgclose = CreateObject (8210,1024.18359375,-2008.80273438,3.24494743,0.00000000,0.00000000,83. 9959716) ;
Reply
#2

I`ll give it a try to help you:

First:
pawn Код:
new sacgclose;
Second, you need to create the closed gate, using the 'sacgclose' we used before. This is done in OnGameModeInit function:
pawn Код:
sacgclose = CreateObject (8210,1024.183,-2008.802,3.244,0.00000000,0.00000000,83. 995) ;
Now, we move on to commands. You need to put these commands under OnPlayerCommandText

pawn Код:
if(!strcmp(cmdtext,"/fbo",true))
    {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1024.183,-2008.802,3.244))
            {
            MoveObject(sacgclose, 1024.184,-2008.802,15.244, 2.0); // (sacgclose, X,Y,Z, MovingSpeed)
                SendClientMessage(playerid, 0xAA0000AA, "You have opened the Coast Guard Bay gates please /fbc.");
            return 1;
             }
         else SendClientMessage(playerid, 0xAA0000AA, "You must be near the gate to open it.");
      else
      return 1;
     }
Now with the close command:
pawn Код:
if(!strcmp(cmdtext,"/fbc",true))
    {
            if(IsPlayerInRangeOfPoint(playerid, 10.0, 1024.183,-2008.802,3.244))
            {
            MoveObject(sacgclose, 1024.184,-2008.802,15.244, 2.0);
                SendClientMessage(playerid, 0xAA0000AA, "You have closes the Coast Guard Bay gates.");
            return 1;
             }
         else SendClientMessage(playerid, 0xAA0000AA, "You must be near the gate to open it.");
      else
      return 1;
     }
I made it with IsPlayerInRangeOfPoint, which checks if the player is near the gate which you want to open ... if you do it without a IsPlayerInRangeOfPoint, you would`ve been able to open the gate from anywhere ...

Hope I helped ... if you have any questions, feel free to post or pm me.

ps: You don`t need any:
pawn Код:
new aacgopen
You need only 1 gate created, which you'll move with /fbo and /fbc commands.
Reply
#3

lmfao that's funny we had that same coast guard command.
Reply
#4

Lol seriously i played at ARP when Rick was the Admiral we had that command /fbo = fire bay open /fbc = fire bay close
Reply
#5

Quote:
Originally Posted by Alex_Carillo
Посмотреть сообщение
Lol seriously i played at ARP when Rick was the Admiral we had that command /fbo = fire bay open /fbc = fire bay close
So? Did you fix your problem ?
Reply
#6

Quote:
Originally Posted by Alex_Carillo
Посмотреть сообщение
Lol seriously i played at ARP when Rick was the Admiral we had that command /fbo = fire bay open /fbc = fire bay close
what antonio112 said is one of the ways it can be done.
Reply
#7

my server wont start with that command lol ima have too see
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)