SA-MP Forums Archive
How to create a marker? - 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: How to create a marker? (/showthread.php?tid=106927)



How to create a marker? - Angelo94 - 06.11.2009

I read stuff in samp wiki, but i didn't understand it...i just want to create a marker with coordinates, color, size wich will teleport me. I'd do it of my own with mta map editor,but i don't know where it saves the map editings! (i have Vista)
and i also can't recognize them


Re: How to create a marker? - MrXavier - 06.11.2009

Its real simple like this for instance....

with the defines/forwards
Код:
new ENTER;
new EXIT;
Under OnGameModeInit
Код:
ENTER = CreatePickup(ICON ID,TYPE,xcoordinate,ycoordinate,zcoordinate, virworld);
EXIT = CreatePickup(xcoordinate,ycoordinate,zcoordinate);
Then make a category like this
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == ENTER)
  {
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,INTERIOR ID);
	}
	
	if(pickupid == EXIT)
	{
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,0);
	}
	return 1;
}
You can use whatever term you want. I opted for it to be called enter/exit. If you want, tell me where you want the icon, and what interior you want to go to. I will script it for ya


Re: How to create a marker? - Eazy_Efolife - 06.11.2009

Quote:
Originally Posted by MrXavier
Its real simple like this for instance....

with the defines/forwards
Код:
new ENTER;
new EXIT;
Under OnGameModeInit
Код:
ENTER = CreatePickup(ICON ID,TYPE,xcoordinate,ycoordinate,zcoordinate, virworld);
EXIT = CreatePickup(xcoordinate,ycoordinate,zcoordinate);
Then make a category like this
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == ENTER)
  {
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,INTERIOR ID);
	}
	
	if(pickupid == EXIT)
	{
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,0);
	}
	return 1;
}
You can use whatever term you want. I opted for it to be called enter/exit. If you want, tell me where you want the icon, and what interior you want to go to. I will script it for ya
You're public OnPlayerPickUpPickup(playerid, pickupid) isnt correct, If you are going to use 2 or more pickups you have to change the line to "else if" This is the fixed code:

Код:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == ENTER)
  {
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,INTERIOR ID);
	}
	
	else if(pickupid == EXIT)
	{
	SetPlayerPos(playerid,xcoordinate,ycoordinate,zcoordinate);
	SetPlayerInterior(playerid,0);
	}
	return 1;
}



Re: How to create a marker? - Daren_Jacobson - 07.11.2009

what the fail? you do not HAVE to use else if ever, EVER.



Re: How to create a marker? - saiberfun - 07.11.2009

Quote:
Originally Posted by Daren_Jacobson
what the fail? you do not HAVE to use else if ever, EVER.
had the problem ones after onplayerpickuppickup too that it ddn't work witout else if^^

i think u only ned it there but usually u don't need it^^


Re: How to create a marker? - Daren_Jacobson - 07.11.2009

in the first place it is a better idea to use IsPlayerInRangeOfPoint(stuff and coords of pickup); because of this (unless you use ysf of course)


Re: How to create a marker? - Eazy_Efolife - 07.11.2009

Quote:
Originally Posted by Daren_Jacobson
in the first place it is a better idea to use IsPlayerInRangeOfPoint(stuff and coords of pickup); because of this (unless you use ysf of course)
in the first place he already found his answer i guess. So he probably got his answer no need to reply


Re: How to create a marker? - Angelo94 - 07.11.2009

ENTER = CreatePickup(ICON ID,TYPE,xcoordinate,ycoordinate,zcoordinate, virworld);
EXIT = CreatePickup(xcoordinate,ycoordinate,zcoordinate);

Help, where do i find icon ids and types?





Re: How to create a marker? - dice7 - 07.11.2009

https://sampwiki.blast.hk/wiki/CreatePickup


Re: How to create a marker? - Angelo94 - 07.11.2009

ok but i want a marker like those you create in mta map editor, where you can edit colors and size....