SetPlayerVirtualWorld(playerid, HouseInfo[i][hVirtualWorld]); |
SetPlayerVirtualWorld(playerid, 0); |
if(strcmp(cmd,"/entrar",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]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
//GameTextForPlayer(playerid,"~w~Bem-Vindo em Casa",5000,1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
PlayerInfo[playerid][pCasaEntrada] = i;
SetPlayerVirtualWorld(playerid, HouseInfo[i][hVirtualWorld]);
}
else
{
GameTextForPlayer(playerid,"~r~Fechada",4000,1);
}
}
}
//
if(strcmp(cmd,"/sair",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(PlayerInfo[playerid][pCasaEntrada] == i)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pCasaEntrada] = 255;
SetPlayerVirtualWorld(playerid, 0);
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,50.0);
}
}
return true;
}
}
}
// entrar
else if (PlayerToPoint(1.5,playerid,2127.6575,2379.1746,10.8203)) // 1 casa
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2307.2151,-16.1428,26.7496);
SetPlayerVirtualWorld(playerid,2);
}
else if(PlayerToPoint(1.0,playerid,2364.2720,2377.6091,10.8203)) // 2 casa
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2305.5806,-16.1346,26.7496);
SetPlayerVirtualWorld(playerid,3);
}
// sair
else if(PlayerToPoint(1.5,playerid,2304.7061,-15.9520,26.7422)) // 1 casa
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2127.5940,2376.7136,10.8203);
SetPlayerVirtualWorld(playerid,0);
}
else if(PlayerToPoint(1.5,playerid,2305.5806,-16.1346,26.7496)) // 2 casa
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2364.0562,2377.6636,10.8203);
SetPlayerVirtualWorld(playerid,0);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/meuVW", true) == 0)
{
new string[20];
format(string, sizeof(string), "Virtual World: %i", GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid, -1,string);
return 1;
}
return 0;
}
if (strcmp(cmdtext, "/MeLevaProMundo3", true) == 0)
{
SetPlayerVirtualWorld(playerid, 3);
return 1;
}
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 10);
SetPlayerVirtualWorld(playerid, 10);
new world = GetVehicleVirtualWorld(vehicleid);
SetPlayerVirtualWorld(playerid, world);
eu nгo entendi foi nada. Mas pelo que eu vejo, os codes jб estгo no comando.
#Edit Vou responder sua pergunta. O que й Virtual World? Resumidamente, sгo vбrios mundos diferentes. VW 1 й um mundo, VW 2 й outro, assim vai. Quem estiver no VW 1 nгo ver quem estб no VW 2. Existem: GetPlayerVirtualWorld: Pega o VW do Player SetVehicleVirtualWorld Seta VW do Veнculo SetPlayerVirtualWorld: Seta VW do Player. |
if(strcmp(cmd,"/sair",true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(PlayerToPoint(3,playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]))
{
if(PlayerInfo[playerid][pCasaEntrada] == i)
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pCasaEntrada] = 255;
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,50.0);
}
}
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd,"/entrar",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]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][hVirtualWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
PlayerInfo[playerid][pCasaEntrada] = i;
return 1;
}
else
{
GameTextForPlayer(playerid,"~r~Fechada",4000,1);
}
}
}
}
return 1;
}
// entrar
else if (PlayerToPoint(1.5,playerid,2127.6575,2379.1746,10.8203)) // 1 casa
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,2);
SetPlayerPos(playerid,2307.2151,-16.1428,26.7496);
}
else if(PlayerToPoint(1.0,playerid,2364.2720,2377.6091,10.8203)) // 2 casa
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,3);
SetPlayerPos(playerid,2305.5806,-16.1346,26.7496);
}
else if(PlayerToPoint(1.5,playerid,2304.7061,-15.9520,26.7422)) // 1 casa
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,2127.5940,2376.7136,10.8203);
}
else if(PlayerToPoint(1.5,playerid,2305.5806,-16.1346,26.7496)) // 2 casa
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,2364.0562,2377.6636,10.8203);
}