[Help] Walk in Teleport Marker
#1

Hello everyone, since the last time you have all helped me I have been a busy bee working on new commands. I also removed all the cars that came with SAMP by default. So I have been working hard to add vehicles back to the map but in my own way. Is doing so I added a few Leviathans to the restricted area location west of Bone County. I added on the roofs of two of the buildings, but there is no way to get up there without flying, hacking, or jumping vehicles.

To correct this I did /save for the entrance and exit of where I want the teleport markers to be. By teleport markers, I mean those yellow triangles that kinda go up and down. When a player walks into one I want it to take them to the linked exit, and vice versa. When the player walks into the exit one it will take him to the entrance.

I am confused on what my code should look like and how I should go about getting the Pos if /save will not work. As always I am very grateful for all of your insight and help to my issues. You make my SAMP experience a very pleasant one.

-
0Z3ro0
Reply
#2

Well if by "yellow triangles" you mean those diamond used in Singleplayer to enter buildings..They are called pickups.

You create a pickup with CreatePickup function(look up wiki for parameters and more info). The function returns and ID which you compare under OnPlayerPickUpPickup and if it matches then you place the player inside for example.



pawn Код:
new pickup;

public OnGameModeInit()
{
   pickup  = CreatePickup(1559,1,0.0,0.0,2.0,0);
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
  if(pickupid == pickup)
  {
      //Well we place him inside.
   }
}
I'm sure there are tutorials for this
Reply
#3

Quote:
Originally Posted by dusk
Посмотреть сообщение
Well if by "yellow triangles" you mean those diamond used in Singleplayer to enter buildings..They are called pickups.

You create a pickup with CreatePickup function(look up wiki for parameters and more info). The function returns and ID which you compare under OnPlayerPickUpPickup and if it matches then you place the player inside for example.



pawn Код:
new pickup;

public OnGameModeInit()
{
   pickup  = CreatePickup(1559,1,0.0,0.0,2.0,0);
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
  if(pickupid == pickup)
  {
      //Well we place him inside.
   }
}
I'm sure there are tutorials for this
I just looked it up on wiki and it helped explain your code a lot. Thank you for pointing in the direction. I am a bit confused on it this can go in my command FS or if I need to make a new FS. Does it even go in a FS?
Reply
#4

Well I guess it CAN go into a FS....

But I would advise you to put it in your gamemode.
Reply
#5

Quote:
Originally Posted by dusk
Посмотреть сообщение
Well I guess it CAN go into a FS....

But I would advise you to put it in your gamemode.
No no, Your the expert I am just a novice learning under you all. If you say your advice is for me to add this to the gamemode then that is what will be done. I can not seem to find the ID on wiki for this marker nor do I know it's official now. Is it just called Yellow Diamond?
Reply
#6

I'm not 100% sure but I believe this is the model: 1559 - Interior enter/exit diamond
Reply
#7

Quote:
Originally Posted by dusk
Посмотреть сообщение
I'm not 100% sure but I believe this is the model: 1559 - Interior enter/exit diamond
Код:
public OnPlayerPickUpPickUp(playerid,pickupid)
{
   if(pickupid == pickup)
   {
	   //what goes here??
   }
}
Bit confused on this part, I am still new to this language of coding. I pick certain things up, but other things I am lost on. Forgive me if my question annoy you.
Reply
#8

Code which will be executed if a player enters that pickup.

You said you want to create an entrance, so you should add SetPlayerPos, SetPlayerInterior there.
Reply
#9

Quote:
Originally Posted by dusk
Посмотреть сообщение
Code which will be executed if a player enters that pickup.

You said you want to create an entrance, so you should add SetPlayerPos, SetPlayerInterior there.
I figured that, I tried it before my last reply. I got this error message;

Код:
A:\Users\Administrator\Desktop\SAMP Server\gamemodes\grandlarc.pwn(521) : warning 235: public function lacks forward declaration (symbol "OnPlayerPickUpPickUp")
A:\Users\Administrator\Desktop\SAMP Server\gamemodes\grandlarc.pwn(525) : error 017: undefined symbol "x"
This is what my code looks like;

Код:
public OnPlayerPickUpPickUp(playerid,pickupid)
{
   if(pickupid == pickup)
   {
	   SetPlayerPos(playerid, x, y, z);
	   SetPlayerInterior(playerid, 0);
   }
}
My next guess would be to use the /save x y and z and subsitute it for the x y and z? But if that is the case then where do I tell the script to send the player?
Reply
#10

You miss-spelled the callback name. It's OnPlayerPickUpPickup

And you should change x/y/z to coordinates of the spot you want to be taken.
You can see interior Id and entrance coordinates here: https://sampwiki.blast.hk/wiki/InteriorIDs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)