help wit vw so i can have more houses
#1

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);
						}
					}
				}
			}
Reply
#2

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

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
Reply
#4

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..
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)