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



need help - luckie12 - 29.04.2009

have anyone a easy code for moving objects (GATES)

thx...alot....


Re: need help - *ToM* - 29.04.2009

ON top of your script add on

Код:
new gate1; // name of the gate, change it to whatever you want
Under OnGameModeInit add

Код:
gate1 = CreateObject(id_of_the_gate, coords); // coords of closed gate
On Player Command Text add

Код:
	if (strcmp("/opengate1", cmdtext, true) == 0)
	{
		MoveObject(opengate1, coords_of_the_gate_when_its_opened, 5); //5 is the speed of opening and the coords when the gate is opened
		SendClientMessage(playerid, 0x00F600AA, "GATE OPENED !");
		return 1;
	}
If you're still confused, check out my LSPD & LVPD Gates, and look how it's been made, the link is in my signature


Re: need help - luckie12 - 29.04.2009

Quote:
Originally Posted by Toniu_
ON top of your script add on

Код:
new gate1; // name of the gate, change it to whatever you want
Under OnGameModeInit add

Код:
gate1 = CreateObject(id_of_the_gate, coords); // coords of closed gate
On Player Command Text add

Код:
	if (strcmp("/opengate1", cmdtext, true) == 0)
	{
		MoveObject(opengate1, coords_of_the_gate_when_its_opened, 5); //5 is the speed of opening and the coords when the gate is opened
		SendClientMessage(playerid, 0x00F600AA, "GATE OPENED !");
		return 1;
	}
wat do you mean with
pawn Код:
coords_of_the_gate_when_its_opened
?



Re: need help - *ToM* - 29.04.2009

Coords when the gate is opened/closed, you need them to make that code

like you have AddPlayerClass(0,[b]323.25,655.31,787.12); <- these are coords


Re: need help - luckie12 - 29.04.2009

Quote:
Originally Posted by Toniu_
Coords when the gate is opened/closed, you need them to make that code
is it the same corord as opened or closed?


Re: need help - *ToM* - 29.04.2009

how could it be the same ? Think a little bit.

I suggest you to use MTA Map Editor , to place your gate perfectly or In Game Object Editor.

First put it as closed, then put it as you want it to be when its opened


Re: need help - luckie12 - 29.04.2009

Quote:
Originally Posted by Toniu_
how could it be the same ? Think a little bit.

I suggest you to use MTA Map Editor , to place your gate perfectly or In Game Object Editor.

First put it as closed, then put it as you want it to be when its opened
i have already coords

pawn Код:
CreateObject(980, 1385.557617, -2688.828857, 272.734619, 0.0000, 0.0000, 270.0000);
CreateObject(980, 1557.510864, -2539.105957, 15.320267, 0.0000, 0.0000, 0.0000);



Re: need help - *ToM* - 29.04.2009

so what was your problem ?? LOL well done, now follow the code


Re: need help - luckie12 - 29.04.2009

Quote:
Originally Posted by Toniu_
so what was your problem ?? LOL well done, now follow the code
ok i hope it works


Re: need help - luckie12 - 29.04.2009

Quote:
Originally Posted by Toniu_
so what was your problem ?? LOL well done, now follow the code
and i can put it in my FS ?