SA-MP Forums Archive
Gates. - 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: Gates. (/showthread.php?tid=74242)



Gates. - -eXo - 20.04.2009

Could someone help me? I've tried and can't create a command so when you type /gate1open it opens, and /gate1close it closes.

Here's the gate I'm trying to make do the command if anyone can help.

Код:
CreateObject(971,631.5333,-595.8685,16.3359,0.000000,0.000000,269.105682); //SD3



Re: Gates. - StrickenKid - 20.04.2009

do something like this:


// at the top:
new gate1;
// gamemodeinit:
gate1 = CreateObject(971,631.5333,-595.8685,16.3359,0.000000,0.000000,269.105682); //SD3

// command:


if (strcmp( cmdtext, "/gate1open", true) == 0)
{
SendClientMessage(playerid, your color, "Gate 1 Opening!");
MoveObject(gate1, newx, newy, newz, speed);
return 1;
}


-Ethan


Re: Gates. - -eXo - 20.04.2009

What would be the cords if I wanted it to go into the ground?. Then for /gate1close?.


Re: Gates. - Burridge - 20.04.2009

Well the closing corrdinates would be the same as where the object is place.

Код:
631.5333,-595.8685,16.3359
Thats the closing one.

The open one you have to do yourself, as it has to open where YOU want it to.


Re: Gates. - StrickenKid - 20.04.2009

if you want it to under the ground, change the Z negatively. and for /gateoneclose just do the opposite of /gateoneopen

all samp functions are formatted this way:
Код:
X, Y, Z
so just do -10 on the z to make it go down.


Re: Gates. - -eXo - 20.04.2009

Thanks, they work now.


Re: Gates. - StrickenKid - 20.04.2009

no problem


Re: Gates. - Francis[French] - 21.04.2009

Quote:
Originally Posted by <__Ǝthan__>
do something like this:


// at the top:
new gate1;
// gamemodeinit:
gate1 = CreateObject(971,631.5333,-595.8685,16.3359,0.000000,0.000000,269.105682); //SD3

// command:


if (strcmp( cmdtext, "/gate1open", true) == 0)
{
SendClientMessage(playerid, your color, "Gate 1 Opening!");
MoveObject(gate1, newx, newy, newz, speed);
return 1;
}


-Ethan
Hi there,

Lol you lost some time there, don't you think? :P

Have fun scripting.

Kind regards,

Francis Morissette
SA-MP Scripter
http://sa-mp.com


Re: Gates. - -eXo - 21.04.2009

How would I make the open and close command only work for members of faction 2?.


Re: Gates. - rabit7 - 22.04.2009

Quote:
Originally Posted by -eXo
How would I make the open and close command only work for members of faction 2?.
if gf, it

Quote:
Код:
PlayerInfo[playerid][pMember]
Quote:
Код:
if(PlayerInfo[playerid][pMember] == NUMBER_FACTION)