SA-MP Forums Archive
Gate problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gate problem (/showthread.php?tid=93985)



Gate problem - laser50 - 27.08.2009

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.


Re: Gate problem - jonrb - 27.08.2009

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



Re: Gate problem - Kyle - 27.08.2009

Код:
    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


Re: Gate problem - laser50 - 27.08.2009

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


Re: Gate problem - Kyle - 27.08.2009

We all make mistakes somtime


Re: Gate problem - laser50 - 27.08.2009

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


Re: Gate problem - hluistella - 29.08.2009

Код:
    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