SA-MP Forums Archive
Enterable house script help - 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: Enterable house script help (/showthread.php?tid=86830)



Enterable house script help - mongo11 - 16.07.2009

Hey, i'm trying to get it so that the tennis courts mansion in LS is an enterable building with this interior: http://weedarr.wdfiles.com/local--fi...ouseunused.jpg

I have got the 'info' icon at the entrance to the house and i want it so if you do /enter at the icon you enter the interior.

the only problem im having really is getting is getting is getting it so that if you do /enter at ONLY the position of the 'info' icon will you enter. at the moment its if i do /enter anywhere you get moved.

Код:
	if (strcmp("/enter", cmdtext, true, 10) ==0)
	{
	new Float:x, Float:y, Float:z;
	if GetPlayerPos(playerid, x, y, z) == itahouse*then
	SetPlayerPos(playerid, 2324.419921,-1145.568359,1050.710083);
	SetPlayerInterior(playerid,12);
	return 1;
	}
itahouse is the name of the pickup, which is the 'info' icon.

I await your replys.

thank you.


Re: Enterable house script help - Abernethy - 16.07.2009

Use PlayerToPoint, using GetPlayerPos will result in your trying for hours to try & get the exact position.


Re: Enterable house script help - mongo11 - 16.07.2009

Ok i have put in PlayerToPoint but now im getting afew errors

Код:
	if (strcmp("/enter", cmdtext, true, 10) ==0)
	{
	new Float:x, Float:y, Float:z;
	if PlayerToPoint(playerid, x, y, z) == itahouse*then
	SetPlayerPos(playerid, 2324.419921,-1145.568359,1050.710083);
	SetPlayerInterior(playerid,12);
	return 1;
	}
Quote:

C:\Users\Luke\Documents\GTA San Andreas\here\gamemodes\redmob.pwn(705) : error 017: undefined symbol "PlayerToPoint"
C:\Users\Luke\Documents\GTA San Andreas\here\gamemodes\redmob.pwn(704) : warning 203: symbol is never used: "z"
C:\Users\Luke\Documents\GTA San Andreas\here\gamemodes\redmob.pwn(704) : warning 203: symbol is never used: "y"
C:\Users\Luke\Documents\GTA San Andreas\here\gamemodes\redmob.pwn(704) : warning 203: symbol is never used: "x"
C:\Users\Luke\Documents\GTA San Andreas\here\gamemodes\redmob.pwn(713) : warning 215: expression has no effect

Edit: Hazar! i fixed it, found the script i was missing for the PlayerToPoint, and i managed to fix the being able to enter the house from anywhere problem.

thanks for your help