SA-MP Forums Archive
Gate help! - 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 help! (/showthread.php?tid=152415)



Gate help! - candyboy - 04.06.2010

Hi,
Can anyone make a automatic gate for me with cmd open and close ? This is the gate code

CreateObject(987, 315.5947265625, -1172.8193359375, 79.9140625, 0.000000, 0.000000, 224.30236816406); //




Regards
candyboy




Re: Gate help! - TTJJ - 04.06.2010

Hi candyboy,

It's really easy code really.

This is how I would of tried it.

Код:
//Top of script

new gate;//making the global variable for later use.

//On GameModeInit

gate = CreateObject(987, 315.5947265625, -1172.8193359375, 79.9140625, 0.000000, 0.000000, 224.30236816406); //Assigning a value to the global variable we previously made

//OnPlayerCommandText

if(strcmp(cmd,"/open",true) == 0)
{
  if(IsPlayerInRangeOfPoint(playerid,10.0,315.5947265625, -1172.8193359375, 79.9140625))
  {
    MoveObject(gate,NEWX,NEWY,NEWZ,SPEED);//We are then moving the object, now known as GATE to its new position.
  }
  return 1;
}
Pretty simple stuff. Give it a try.

Cheers,

TJ


Re: Gate help! - candyboy - 04.06.2010

yo TTJJ,
TTJJ i need gate closing command also. Also i need for 0.2x not for 0.3a And you for doing the script for me!!!! And




Regards
candyboy



Re: Gate help! - Jay. - 04.06.2010

Quote:
Originally Posted by candyboy
yo TTJJ,
TTJJ i need gate closing command also. Also i need for 0.2x not for 0.3a And you for doing the script for me!!!! And




Regards
candyboy
Like TTJ said its realy simple


try this

Top of script

Код:
new gate;
Under OnGameModeInit
Код:

gate = CreateObject(987, 315.5947265625, -1172.8193359375, 79.9140625, 0.000000, 0.000000, 224.30236816406); //
Код:
if (strcmp("/opengate", cmdtext, true, 10) == 0)
	{   MoveObject(playerid,987, 315.5947265625, -1172.8193359375, 79.9140625, 0.000000, 0.000000, 224.30236816406.5);
        SendClientMessage(playerid,0xFFFFF,"Gates Open");
		return 1;
	}

Код:
if (strcmp("/closegate", cmdtext, true, 10) == 0)
	{   MoveObject(playerid,COORDS OF YOUR GATE CLOSED");
        SendClientMessage(playerid,0xFFFFF,"Gates Closed");
		return 1;
	}

Simple


Jay.


2.0x Version.


Re: Gate help! - candyboy - 04.06.2010

jay the problem is that i donno how to get closed and open coords...please tell me how to save closed and open cords in one MTA file....if i know means i have done it before iself!!!!!


Re: Gate help! - Jay. - 04.06.2010

Make a gate in mta where you want it create it open then create it closed...


Re: Gate help! - candyboy - 04.06.2010

jay can you make one for me?? with that same model id in my house which i show you from my server, and when i did as you said its showing two gate which i did for closed!!!!!!!!!!!!!!


Re: Gate help! - Jay. - 04.06.2010

Off Topic: No i can't realy i don't know where you want it.


Re: Gate help! - Flashy - 04.06.2010

Ehh candyboy? He told you all what you must know. You are probably to lazy or just donґt know how to do this.
If you donґt gonna do that on your own you donґt learn it.
And it is very easy.
So try to make that on your own. If you have some problem with that ask here. But not now. You are asking for a script.
The right place is at the SCRIPT REQUEST THREAD not here.


Re: Gate help! - candyboy - 04.06.2010

Quote:
Originally Posted by Flashy
Ehh candyboy? He told you all what you must know. You are probably to lazy or just donґt know how to do this.
If you donґt gonna do that on your own you donґt learn it.
And it is very easy.
So try to make that on your own. If you have some problem with that ask here. But not now. You are asking for a script.
The right place is at the SCRIPT REQUEST THREAD not here.
Lol i didn't understand anything about MTA !!!!!!!!!!