SA-MP Forums Archive
Help me about gate commands - 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: Help me about gate commands (/showthread.php?tid=152464)



Help me about gate commands - KfirRP - 04.06.2010

Hi,
Can anyone make a automatic gate for me with cmd open and close ? This is the gate code
CreateObject(980, 1263.889526, -2045.712280, 61.069244, 0.0000, 0.0000, 0.0000);

I need it opens and closes. I don't know how to do it, please explain me where to put what..
I'm troubling with that MoveObject many time and I really need it. Thanks you.



Regards
Kfir



Re: Help me about gate commands - Jakku - 04.06.2010

Post the coordinates while the gate is opened.


Re: Help me about gate commands - KfirRP - 04.06.2010

Someone gave the information that I gave and a guy gave him a reply with the Code and like.

Can you explain me more? I'm really new at scripting.


Re: Help me about gate commands - MadeMan - 04.06.2010

You need to have 2 lines of CreateObject (close and open), you only have 1.


Re: Help me about gate commands - KfirRP - 04.06.2010

Okay let me make in the MTA the closed one. Wait please and answer me in 20 minutes after that post been added

Edit:
this is the closed time:
CreateObject(980, 1275.430176, -2045.808960, 61.140751, 0.0000, 0.0000, 0.0000);

It will move to that position. I don't know what's the position in it then you'll know it but this is where it may move to. the location in the line there.


Re: Help me about gate commands - MadeMan - 04.06.2010

http://forum.sa-mp.com/index.php?topic=177821.0

It has been done there.


Re: Help me about gate commands - KfirRP - 04.06.2010

Quote:
Originally Posted by MadeMan
Yup but maybe can you give me what I may do and the close command too please .


Re: Help me about gate commands - MadeMan - 04.06.2010

Top of script:
pawn Код:
new gate;
OnGameModeInit:
pawn Код:
gate = CreateObject(980, 1263.889526, -2045.712280, 61.069244, 0.0000, 0.0000, 0.0000);
OnPlayerCommandText:
pawn Код:
if(strcmp(cmdtext, "/open", true) == 0)
{
  if(IsPlayerInRangeOfPoint(playerid,10.0,1263.889526, -2045.712280, 61.069244))
  {
    MoveObject(gate,1275.430176, -2045.808960, 61.140751,2.0);
  }
  return 1;
}

if(strcmp(cmdtext, "/close", true) == 0)
{
  if(IsPlayerInRangeOfPoint(playerid,10.0,1263.889526, -2045.712280, 61.069244))
  {
    MoveObject(gate,1263.889526, -2045.712280, 61.069244,2.0);
  }
  return 1;
}



Re: Help me about gate commands - KfirRP - 04.06.2010

OMG THANK YOU VERY MUCH !

I'm trying !


Re: Help me about gate commands - KfirRP - 04.06.2010

Thank's you. But now I'm having troubles with adding objects into the server. I'm putting the objects as I need to, in the place that I have to and no errors. But when I'm uploading the mode to the hosted server and uploading the hosted server, getting inside and guess what? nothing added. No objects. can it happen because of many objects? maybe do you know the problem? thanks you.


Re: Help me about gate commands - MadeMan - 04.06.2010

https://sampwiki.blast.hk/wiki/Limits

There is a limit of 254 objects, so it might be the problem if you have more than that.


Re: Help me about gate commands - KfirRP - 04.06.2010

Oh. Okay. I have less than. I don't know what the problem is. . Do you know an other problem that won't make it shown


Re: Help me about gate commands - playbox12 - 04.06.2010

Make sure its under, OnGameModeInit. and make sure that you compiled, and make sure tha tif you changed the name you changed it in server.cfg also.


Re: Help me about gate commands - KfirRP - 04.06.2010

lol im not that idiot ! and oit still un wroks. i really have up to 250 but its CreateDynamicObjectives. It's still the same?