SA-MP Forums Archive
Important !! - 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: Important !! (/showthread.php?tid=553141)



Important !! - nezo2001 - 28.12.2014

One from my Important Important Important Important problem
How to add an interior for any buliding ??


Re: Important !! - Facerafter - 28.12.2014

Use IsPlayerInRangeOfPoint in a /enter cmd.
If they are in range use SetPlayerPos and SetPlayerInterior.


Re: Important !! - nezo2001 - 28.12.2014

lol, Thank You
but there will be many buliding and one command can you give me an example of two bulidings please


Re: Important !! - Facerafter - 28.12.2014

Код:
CMD:enter(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)) 
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	else if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z))
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	else if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z))
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	return 1;
}
This code would only work if you have ZCMD, but it gives you a example how you could do it if you use a different command processor.

You do still have to fill in the values.


Re: Important !! - M4D - 28.12.2014

Use "else if" if you want make /enter command
But you can create pickup infront of building and teleport player into interiors when player picks up pickup
Or you can use this include
https://sampforum.blast.hk/showthread.php?tid=289660


Re: Important !! - nezo2001 - 28.12.2014

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
Код:
CMD:enter(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)) 
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	else if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z))
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	else if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z))
	{
		SetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerInterior(playerid, interiorid);
	}
	return 1;
}
This code would only work if you have ZCMD, but it gives you a example how you could do it if you use a different command processor.

You do still have to fill in the values.
Okai i am using ZCMD but how to get the PlayerPos inside the buliding ??


Re: Important !! - nezo2001 - 28.12.2014

Quote:
Originally Posted by M4D
Посмотреть сообщение
Use "else if" if you want make /enter command
But you can create pickup infront of building and teleport player into interiors when player picks up pickup
Or you can use this include
https://sampforum.blast.hk/showthread.php?tid=289660
Th problem still how to get the pos of the player inside the buliding ??


Re: Important !! - Facerafter - 28.12.2014

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Okai i am using ZCMD but how to get the PlayerPos inside the buliding ??
http://weedarr.wikidot.com/interior
The third column shows the position of the Interior.
The second column shows the interior ID you would fill in at
Код:
SetPlayerInterior(playerid, interiorid);
You can fill in that data and test it out, if you want a different position in that interior go stand on the spot and use /save (Built-in samp cmd). The XYZ will be saved to a file in your GTA User files

EDIT: Here is another list but without pictures. https://sampwiki.blast.hk/wiki/InteriorIDs


Re: Important !! - nezo2001 - 28.12.2014

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
http://weedarr.wikidot.com/interior
The third column shows the position of the Interior.
The second column shows the interior ID you would fill in at
Код:
SetPlayerInterior(playerid, interiorid);
You can fill in that data and test it out, if you want a different position in that interior go stand on the spot and use /save (Built-in samp cmd). The XYZ will be saved to a file in your GTA User files

EDIT: Here is another list but without pictures. https://sampwiki.blast.hk/wiki/InteriorIDs
the problem with this
PHP код:
SetPlayerPos(playeridFloat:xFloat:yFloat:z); 



Re: Important !! - Facerafter - 28.12.2014

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
the problem with this
PHP код:
SetPlayerPos(playeridFloat:xFloat:yFloat:z); 
If you want this interior

it would be
Код:
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerInterior(playerid,17);