SA-MP Forums Archive
help wit vw so i can have more houses - 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: help wit vw so i can have more houses (/showthread.php?tid=66582)



help wit vw so i can have more houses - linxx - 23.02.2009

Hello again guys im just wonering how i would ad vw to houses so i can make 100 houses with different vertual worlds and im stuck at a dead end?? anyone got any ideas on how to do this coz im really stuck headscratching lawl ad idea?? maybe something with Hworld? but any sort of guidence or info on this matter will be greatly appreciated...this is what i have so far

Regards KryTan

Код:
	if(house !=255)
		{
		  if(SpawnChange[playerid]) //If 1, then you get to your house, else spawn somewhere else
		  {
		  	if(HouseInfo[house][hLevel] <= 2)
		  	{
					SetPlayerToTeamColor(playerid);
					SetPlayerInterior(playerid,HouseInfo[house][hInt]);
					SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
					PlayerInfo[playerid][pLocal] = house;
					PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
					return 1;
				}
				else
				{
					SetPlayerToTeamColor(playerid);
					SetPlayerInterior(playerid,HouseInfo[house][hInt]);
					SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
					PlayerInfo[playerid][pLocal] = house;
					PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
					SetPlayerVirtualWorld(playerid, 7);
					return 1;
				}
			}
		}
Код:
	if(strcmp(cmd, "/enter", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
					{
						if(HouseInfo[i][hLevel] = 1)
						{
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
						}
						else
						{
						  SetPlayerVirtualWorld(playerid, 7);
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
					}
				}
			}
Код:
	if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				//printf("House :%d",i);
				if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
					PlayerInfo[playerid][pInt] = 0;
					SetPlayerVirtualWorld(playerid,0);
					PlayerInfo[playerid][pLocal] = 255;
					if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
				}
			}



Re: help wit vw so i can have more houses - x-cutter - 23.02.2009

Why do you check IsPlayerConnected() on every command? Thats very dumb


Re: help wit vw so i can have more houses - linxx - 23.02.2009

both of them cmnds are in different places and theres about 8 else if for each command and thats the top one so it needs to check duh


Re: help wit vw so i can have more houses - x-cutter - 23.02.2009

Quote:
Originally Posted by Krytan
both of them cmnds are in different places and theres about 8 else if for each command and thats the top one so it needs to check duh
duh? That will just slow down the command's execution speed, a not needed check. If a player sends a command, he has to be connected..


Re: help wit vw so i can have more houses - Mikep - 23.02.2009

Yeha im on MSN and I type /exit, sure.


Re: help wit vw so i can have more houses - linxx - 23.02.2009

Lawl kk i get the jist but can anyone help with the issue thanks


Re: help wit vw so i can have more houses - Linxx87 - 14.03.2009

Anyone can fix this i would love to have more than 50 houses o :P