SA-MP Forums Archive
How to make a house system - 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: How to make a house system (/showthread.php?tid=404569)



How to make a house system - [FBI]M.Vulture[XAC] - 03.01.2013

Hey all, do someone know how to make a house system? and you can choose your house interior for some money?

And if 2 players buy a house with "x" interior, i need to set virtual world? will they spawn at the same house?
Something like this:

Код:
public ViewPlayerInteriors(playerid)
{
	new level = pS[HouseLevel];
	new string[128];
	TogglePlayerControllable(playerid,false);
	format(string,sizeof(string),"This Interior Cost %d Points.\nIf you want to this interior click on Buy. Click on Next to few another on.",InteriorPrice[pS[HouseLevel]]);
	ShowPlayerDialog(playerid,HouseDialog+2,DIALOG_STYLE_MSGBOX,"Interiors",string,"Buy","Next");
	if(level == 1) { SetPlayerPos(playerid,244.3357,306.2097,1001.1558); SetPlayerFacingAngle(playerid, 212.7870); SetPlayerCameraPos(playerid,244.3357,306.2097,1001.1558); SetPlayerCameraLookAt(playerid,248.7596,301.9566,999.1484); SetPlayerInterior(playerid,1); }
	if(level == 2) { SetPlayerPos(playerid,2235.1240,-1113.0406,1050.8828); SetPlayerFacingAngle(playerid, 25.4118); SetPlayerCameraPos(playerid,2235.1240,-1113.0406,1050.8828); SetPlayerCameraLookAt(playerid,2229.6697,-1104.1925,1050.8828); SetPlayerInterior(playerid,5); }
	if(level == 3) { SetPlayerPos(playerid,2260.5110,-1133.6814,1050.6403); SetPlayerFacingAngle(playerid, 228.4303); SetPlayerCameraPos(playerid,2260.5110,-1133.6814,1050.6403+2); SetPlayerCameraLookAt(playerid,2267.6460,-1141.3063,1050.6328); SetPlayerInterior(playerid,10); }
	if(level == 4) { SetPlayerPos(playerid,2286.0771,-1133.7708,1051.6364); SetPlayerFacingAngle(playerid, 129.7528); SetPlayerCameraPos(playerid,2286.0771,-1133.7708,1051.6364); SetPlayerCameraLookAt(playerid,2279.3076,-1140.2565,1050.8984); SetPlayerInterior(playerid,11); }
	if(level == 5) { SetPlayerPos(playerid,2213.8416,-1077.2112,1050.4844); SetPlayerFacingAngle(playerid, 60.8422); SetPlayerCameraPos(playerid,2213.8416,-1077.2112,1050.4844); SetPlayerCameraLookAt(playerid,2203.0925,-1072.0521,1050.4766); SetPlayerInterior(playerid,1); } // Sweet's House
	if(level == 6) { SetPlayerPos(playerid,2364.4951,-1133.6687,1050.8750); SetPlayerFacingAngle(playerid, 338.7247); SetPlayerCameraPos(playerid,2364.4951,-1133.6687,1050.8750); SetPlayerCameraLookAt(playerid,2367.7864,-1125.8555,1050.8826); SetPlayerInterior(playerid,8); }
	if(level == 7) { SetPlayerPos(playerid,760.7331,1442.0001,1102.7031); SetPlayerFacingAngle(playerid, 111.2427); SetPlayerCameraPos(playerid,760.7331,1442.0001,1102.7031); SetPlayerCameraLookAt(playerid,742.9857,1436.4650,1102.7031); SetPlayerInterior(playerid,6); }
	if(level == 8) { SetPlayerPos(playerid,18.6380,1340.4008,1084.3750); SetPlayerFacingAngle(playerid, 287.0476); SetPlayerCameraPos(playerid,18.6380,1340.4008,1084.3750); SetPlayerCameraLookAt(playerid,35.3640,1343.0229,1084.3750); SetPlayerInterior(playerid,10); }
	if(level == 9) { SetPlayerPos(playerid,2262.2168,-1205.7747,1049.8534); SetPlayerFacingAngle(playerid, 134.0845); SetPlayerCameraPos(playerid,2262.2168,-1205.7747,1049.8534); SetPlayerCameraLookAt(playerid,2253.6807,-1213.8828,1049.0234); SetPlayerInterior(playerid,10); }
	if(level == 10) { SetPlayerPos(playerid,2490.7764,-1694.0399,1015.2821); SetPlayerFacingAngle(playerid, 229.0254); SetPlayerCameraPos(playerid,2490.7764,-1694.0399,1015.2821); SetPlayerCameraLookAt(playerid,2497.8711,-1703.5431,1014.7344); SetPlayerInterior(playerid,3); }
	if(level == 11) { SetPlayerPos(playerid,-2168.2395,646.1449,1059.6167); SetPlayerFacingAngle(playerid,257.0528); SetPlayerCameraPos(playerid,-2168.2395,646.1449,1059.6167); SetPlayerCameraLookAt(playerid,-2157.6970,640.9517,1057.5861); SetPlayerInterior(playerid,1); } // Wu Zi Mu's
	if(level == 12) { SetPlayerPos(playerid,-228.9833,1393.7954,28.3595); SetPlayerFacingAngle(playerid, 341.1764); SetPlayerCameraPos(playerid,-228.9833,1393.7954,28.3595); SetPlayerCameraLookAt(playerid,-222.4073,1412.1667,27.7734); SetPlayerInterior(playerid,18); } // Lil' Probe'Inn
	if(level == 13) { SetPlayerPos(playerid,2447.2632,-1706.6038,1013.5078); SetPlayerFacingAngle(playerid, 324.9064); SetPlayerCameraPos(playerid,2447.2632,-1706.6038,1013.5078); SetPlayerCameraLookAt(playerid,2456.5479,-1697.3958,1013.5078); SetPlayerInterior(playerid,2); } // Ryder's House
	if(level == 14) { SetPlayerPos(playerid,-2647.9968,1403.4117,921.7266); SetPlayerFacingAngle(playerid, 49.1003); SetPlayerCameraPos(playerid,-2647.9968,1403.4117,918.7266); SetPlayerCameraLookAt(playerid,-2678.9407,1419.0398,907.5712); SetPlayerInterior(playerid,3); } // Pleasure Domes
	if(level == 15) { SetPlayerPos(playerid,2318.1626,-1026.1152,1050.2109); SetPlayerFacingAngle(playerid,341.2934); SetPlayerCameraPos(playerid,2318.1626,-1026.1152,1050.2109); SetPlayerCameraLookAt(playerid,2321.3855,-1009.4319,1050.2109); SetPlayerInterior(playerid,9); } // Save House group 3
	if(level == 16) { SetPlayerPos(playerid,2317.9858,-1149.4595,1050.7031); SetPlayerFacingAngle(playerid,330.2097); SetPlayerCameraPos(playerid,2317.9858,-1149.4595,1050.7031); SetPlayerCameraLookAt(playerid,2327.3640,-1134.9287,1052.1554); SetPlayerInterior(playerid,12); } // Unused Save House
	if(level == 17) { SetPlayerPos(playerid,1294.8848,-838.1891,1085.6328); SetPlayerFacingAngle(playerid,67.9705); SetPlayerCameraPos(playerid,1294.8848,-838.1891,1085.6328); SetPlayerCameraLookAt(playerid,1266.8237,-831.5377,1085.6328); SetPlayerInterior(playerid,5); } // Madd Dogg's Mansion
	return 1;
}