How to create a marker?
#1

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
Reply
#2

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
Reply
#3

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;
}
Reply
#4

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

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^^
Reply
#6

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)
Reply
#7

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
Reply
#8

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

Help, where do i find icon ids and types?


Reply
#9

https://sampwiki.blast.hk/wiki/CreatePickup
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)