SA-MP Forums Archive
[STREAMER] Checkpoint teleporters to shops - 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)
+--- Thread: [STREAMER] Checkpoint teleporters to shops (/showthread.php?tid=608475)



[STREAMER] Checkpoint teleporters to shops - Deroxi - 01.06.2016

Hey there chaps!

So I want to make checkpoints for pretty much every shop in LS. I know how to make teleporters using Streamer. But my question is: I also want multiple teleporters for 1 shop (Cause there is more than 1 burgershot in LS). But I dont really know where to start. I hope you guys could help me out


Re: [STREAMER] Checkpoint teleporters to shops - Deroxi - 01.06.2016

Anyone?


Re: [STREAMER] Checkpoint teleporters to shops - justjamie - 01.06.2016

Wrong section.
This section is meant for scripts you wrote and people can help you fix the errors in it.


Re: [STREAMER] Checkpoint teleporters to shops - Deroxi - 01.06.2016

https://gyazo.com/6c5733b720849a30857816a48cccdd75
"Discussion and help related to CREATING scripts for SA-MP"


Re: [STREAMER] Checkpoint teleporters to shops - justjamie - 01.06.2016

Yes, HELP.
Not asking if we can write a whole script for u lol.


Re: [STREAMER] Checkpoint teleporters to shops - Deroxi - 02.06.2016

I wasnt asking for an entire script, i'd like to do that myself. All asked for was where i have to start.
Read before b*tching pls


Re: [STREAMER] Checkpoint teleporters to shops - xTURBOx - 02.06.2016

He wasn't asking for code, he was just asking how to do it

ONTOPIC: i think it is done by changing virtual world,
i mean like
1st BS = teleports to BS interior and virtual world 1
2nd BS = teleports to BS interior and virtual world 2


Re: [STREAMER] Checkpoint teleporters to shops - Nin9r - 02.06.2016

Make a command like /enter and another one like exit.
There you have to verify if the player is in a position of any burger shot. For example, use PlayerToPoint or IsPlayerInRangeOfPoint to check it.
If the player is in a positon you will use SetPlayerPos and SetPlayerInterior (pos + interior of burger shot ). Then, you have to use a variable like InBurger[playerid] = idburger; to get different values when a player enter in a burger shot. When you make /exit, you will do the same like /enter just you have to verify InBurger[playerid] == 1, 2 etc to put different positions of exit.

Example to put in /enter command:

Код HTML:
if (PlayerToPoint(3.0, playerid,x,y,z)) // position 1 of burger shot
			{
			    SetPlayerInterior(playerid,0); // Burger Shot Interior ID
				SetPlayerPos(playerid,x,y,z); // Burger Shot Interior Pos
                            InBurger[playerid] = 1;
			}
			else if (PlayerToPoint(6.0, playerid,x,y,z)) // position 2 of burger shot
			{
			    SetPlayerInterior(playerid,0); // Burger Shot Interior ID
				SetPlayerPos(playerid,x,y,z); // Burger Shot Interior Pos
                            InBurger[playerid] = 2;
			}
Example to put in /exit command:

Код HTML:
if (PlayerToPoint(3.0, playerid,x,y,z)) // position of exit from burger
			{
                            if(InBurger[playerid] == 1)
                           {
			       SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,x,y,z); // Burger Shot Exit Pos 1 ( pos 1 from /enter command - playertopoint)
                           }
                           if(InBurger[playerid] == 2)
                           {
			       SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,x,y,z); // Burger Shot Exit Pos 2 ( pos 2 from /enter command - playertopoint)
                           }
			}



Re: [STREAMER] Checkpoint teleporters to shops - Deroxi - 02.06.2016

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
He wasn't asking for code, he was just asking how to do it

ONTOPIC: i think it is done by changing virtual world,
i mean like
1st BS = teleports to BS interior and virtual world 1
2nd BS = teleports to BS interior and virtual world 2
That will mean i have to define every bs in LS with a different name?

Quote:
Originally Posted by Nin9r
Посмотреть сообщение
Make a command like /enter and another one like exit.
There you have to verify if the player is in a position of any burger shot. For example, use PlayerToPoint or IsPlayerInRangeOfPoint to check it.
If the player is in a positon you will use SetPlayerPos and SetPlayerInterior (pos + interior of burger shot ). Then, you have to use a variable like InBurger[playerid] = idburger; to get different values when a player enter in a burger shot. When you make /exit, you will do the same like /enter just you have to verify InBurger[playerid] == 1, 2 etc to put different positions of exit.

Example to put in /enter command:

Код HTML:
if (PlayerToPoint(3.0, playerid,x,y,z)) // position 1 of burger shot
			{
			    SetPlayerInterior(playerid,0); // Burger Shot Interior ID
				SetPlayerPos(playerid,x,y,z); // Burger Shot Interior Pos
                            InBurger[playerid] = 1;
			}
			else if (PlayerToPoint(6.0, playerid,x,y,z)) // position 2 of burger shot
			{
			    SetPlayerInterior(playerid,0); // Burger Shot Interior ID
				SetPlayerPos(playerid,x,y,z); // Burger Shot Interior Pos
                            InBurger[playerid] = 2;
			}
Example to put in /exit command:

Код HTML:
if (PlayerToPoint(3.0, playerid,x,y,z)) // position of exit from burger
			{
                            if(InBurger[playerid] == 1)
                           {
			       SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,x,y,z); // Burger Shot Exit Pos 1 ( pos 1 from /enter command - playertopoint)
                           }
                           if(InBurger[playerid] == 2)
                           {
			       SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,x,y,z); // Burger Shot Exit Pos 2 ( pos 2 from /enter command - playertopoint)
                           }
			}
Hmm, I'm not a big fan of the /enter command. However, i will keep this in mind if I won't succeed.