SA-MP Forums Archive
Virtual worlds need 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: Virtual worlds need help (/showthread.php?tid=71541)



Virtual worlds need help - Qeux - 02.04.2009

does this work as virtual worlds it was in my script but idk if it will work when i add more houses
Код:
	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;
					PlayerInfo[playerid][pLocal] = 255;
					if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
				}
			}



Re: Virtual worlds need help - Pyrokid - 02.04.2009

Did you... test it?


Re: Virtual worlds need help - grimbluelord - 02.04.2009

Код:
	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]))
				{
				  if(HouseEntered[playerid] == i)
				  {
						SetPlayerInterior(playerid,0);
						SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
						PlayerInfo[playerid][pInt] = 0;
						PlayerInfo[playerid][pLocal] = 255;
						SetCameraBehindPlayer(playerid);
						SetPlayerVirtualWorld(playerid,0);
						HouseEntered[playerid] = 255;
						if(HouseInfo[i][hHel] == 1)
						{
							new Float:tempheal;
							GetPlayerHealth(playerid,tempheal);
							if(tempheal < 100.0)
							{
								SetPlayerHealth(playerid,100.0);
							}
						}
						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)
					{
						SetPlayerInterior(playerid,HouseInfo[i][hInt]);
						SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
						SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
						GameTextForPlayer(playerid, "~w~Welcome ~n~~r~Home", 5000, 1);
						PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
						PlayerInfo[playerid][pLocal] = i;
						HouseEntered[playerid] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
					}
				}
			}
++ House


Код:
enum hInfo
{
	Float:hEntrancex,
	Float:hEntrancey,
	Float:hEntrancez,
	Float:hExitx,
	Float:hExity,
	Float:hExitz,
	hHealthx,
	hHealthy,
	hHealthz,
	hArmourx,
	hArmoury,
	hArmourz,
	hOwner[MAX_PLAYER_NAME],
	hDiscription[MAX_PLAYER_NAME],
	hValue,
	hHel,
	hArm,
	hInt,
	hLock,
	hOwned,
	hRooms,
	hRent,
	hRentabil,
	hTakings,
	hVec,
	hVcol1,
	hVcol2,
	hDate,
	hLevel,
	hWorld
};

new HouseInfo[250][hInfo];

new HouseEntered[MAX_PLAYERS];
CFG File : http://uploaded.to/?id=49rvhm


Re: Virtual worlds need help - Qeux - 03.04.2009

thanks


Re: Virtual worlds need help - Shellegg - 03.04.2009

on topic:

what is the diference between:

pawn Код:
SetPlayerInterior(playerid, interiorid);
and

pawn Код:
SetPlayerVirtualWorld(playerid, worldid);
I know that interior id is the id of the interior when we type /interior.

But what is worldid?

Thank you


Re: Virtual worlds need help - grimbluelord - 03.04.2009

-2282.419921,979.330017,70.860000,261.000000,1286.0 00000,1080.199951,0,0,0,0,0,0,The State,4 room apartment,19000,0,0,1,1,0,0,1500,1,0,418,-1,-1,133,0,249


my english bad

red text worldid..