Gate problem
#1

hi, i decided to make a small FS with gates and stuff
the problem is, the command works fine but the gates are not moving :S

first i did (of course)

new gate1o; (opened gate)
and new gate1c; (closed gate)

after, i did

gate1o = createobject bla bla bla
and the other one of course,

then i`ll show my commands:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/gate1o", cmdtext, true, 10) == 0)
	{
    MoveObject(gate1o, 96.627892, 1925.867065, 18.861610, 2.0);
    SendClientMessage(playerid, COLOR_GREEN, "Gate opening...");
		return 1;
	}
  if(strcmp("/gate1c", cmdtext, true, 10) == 0)
  MoveObject(gate1c, 96.712158, 1920.029419, 18.852978, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate closing...");
i did nothing wrong i guess, i have used a tutorial for this +samp wiki

my second problem was, how can i remove the gate? because i only want 1 to show and now it are 2 gates, the opened and the closed :\


thx.
Reply
#2

you need only one object that moves between closed and open positions
Reply
#3

Код:
    if (strcmp("/gateopen", cmdtext, true, 10) == 0)
    {
    MoveObject(gate1, 96.627892, 1925.867065, 18.861610, 2.0);
    SendClientMessage(playerid, COLOR_GREEN, "Gate opening...");
    return 1;
    }

   if(strcmp("/gateclose", cmdtext, true, 10) == 0)
   {
   MoveObject(gate1, 96.712158, 1920.029419, 18.852978, 2.0);
   SendClientMessage(playerid, COLOR_GREEN, "Gate closing...");
   }
No need to define two gates

Just do

new gate1;

By the way add the new code i did for you
Reply
#4

lool i was getting a drink and i think i know what was wrong, i did for closed Moveobject(name, coords for close) etc

the most noobish mistake i can make :P
Reply
#5

We all make mistakes somtime
Reply
#6

ok, i switched them, now the closed command opens the gate and the open command closes it :\
and, when i do /lol or whatever command you can imagine, it just uses the close gate command :S
Reply
#7

Код:
    if (strcmp("/gateopen", cmdtext, true, 10) == 0)
    {
    MoveObject(gate1, 96.712158, 1920.029419, 18.852978, 2.0);
    SendClientMessage(playerid, COLOR_GREEN, "Gate opening...");
    return 1;
    }

   if(strcmp("/gateclose", cmdtext, true, 10) == 0)
   {
   MoveObject(gate1,96.627892, 1925.867065, 18.861610, 2.0 );
   SendClientMessage(playerid, COLOR_GREEN, "Gate closing...");
   return 1;
   }
Try This
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)