SA-MP Forums Archive
How to make a interior with PlayerToPoint - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: How to make a interior with PlayerToPoint (/showthread.php?tid=52205)



How to make a interior with PlayerToPoint - Benne - 27.09.2008

.:How to make a easy interior:.
The first thing you do is put this in top of your filterscript in your pawno.
Right down under
Code:
#Include <a_Samp>
Code:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
So it will look like this:
Code:
#Include <a_Samp> 

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Scroll down to the last line in the script and put this as a new line:

Code:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
Then you scroll up to:

Code:
public OnPlayerCommandText(playerid, cmdtext[])
And put this in:

Code:
 if(!strcmp("/Enter", cmdtext, true) && PlayerToPoint(1.5 ,playerid, Float: X,Float: Y,Float: Z))
 {
	SetPlayerInterior(playerid, interiorid);
	SetPlayerPos(playerid,Float: X,Float: Y,Float: Z);
	CreatePickup(model,type, Float: X,Float: Y,Float: Z);
	return 1;
 }
 if(!strcmp("/Exit", cmdtext, true) && PlayerToPoint(1.5 ,playerid,Float: X,Float: Y,Float: Z))
 {
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,Float: X,Float: Y,Float: Z);
	return 1;
	}
Then forfill in the: Float: X, Float: Y, Float: Z cordinates.

I maked an example for you.

Example:

At the door you see a red marker.
There you can press enter at my script:

Code:
if(!strcmp("/Enter", cmdtext, true) && PlayerToPoint(1.5 ,playerid,252.8745,-92.3390,3.5354))
 {
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,262.1704,-84.3840,65.1329);
	CreatePickup(1239,2,252.8745,-92.3390,3.5354);
	return 1;
 }
 if(!strcmp("/Exit", cmdtext, true) && PlayerToPoint(1.5 ,playerid,262.1704,-84.3840,65.1329))
 {
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,252.8745,-92.3390,3.5354);
	return 1;
 	}
 return 0;
 }
you can go and find your interior at https://sampwiki.blast.hk/wiki/Category_...Documentation.


-If you see any things you don't understand post them...
-Kristian Benne




Re: Easy interior make - Karlip - 27.09.2008

The original SA-MP wiki is up.
No need to direct link to copies.


Re: Easy interior make - kalle - 04.10.2008

This is a great tutorial, actually ppl can use this for much stuff so i give yopu a double point


Re: Easy interior make - Kanji_Suzuki - 20.01.2009

hmm dont work for me


Re: Easy interior make - klavins21 - 21.01.2009

ar that wiki link isn`t any text in it


Re: Easy interior make - BioFreeze - 21.01.2009


You don't tell people here how to create a interior. You only move them to a other position by using PlayerToPoint. Creating interiors is a whole other story. ( Can't be done , you can only create something like it with using objects )


Re: How to make a interior with PlayerToPoint - Criss_Angel - 27.06.2009

Hey in Setplayerpos is it x,y,z


Re: Easy interior make - Serediucr - 27.06.2009

Quote:
Originally Posted by |Johny|
ar that wiki link isn`t any text in it
get interior id by being in it and press /interior


Re: How to make a interior with PlayerToPoint - Ignas1337 - 28.06.2009

also it could be done with an array which would be so much nicer and it could be done OnPlayerKeyStateChange, but that's all up to scripters to do themselves as i've :P


Re: How to make a interior with PlayerToPoint - shady91 - 28.06.2009

lol i made my own int i used a box then made door etc so you cant enter then put gates up on second floor made it into a jail you would neva belive what it was before lol it looks sweet ill post it in a min i made it so its for int 1 and VW 5 ill show you what i mean.