08.03.2012, 14:40
(
Последний раз редактировалось Matheus_Ecko; 08.03.2012 в 15:39.
)
Oque й um Virtual World?
Um virtual world й uma funзгo que seta o player б um mundo diferente que ele nasceu.
Ele й muito usado para usar o mesmo interior em 2 hqs. A funзгo funciona assim
Como vocк pode ver usamos o mesmo interior para 2 locais diferentes (Casa 1 e Casa 2)
Mais Matheus eu ao sair do interior eu saio no mesmo lugar da outra HQ!
Entгo й sу vocк usar a funзгo abaixo.
Criticas? Sujestoes? Sу falar ai
Crйditos:
Matheus Vieira pelo tutorial.
Tutorial feito em resposta ao tуpico: https://sampforum.blast.hk/showthread.php?tid=324086&page=2
Um virtual world й uma funзгo que seta o player б um mundo diferente que ele nasceu.
Ele й muito usado para usar o mesmo interior em 2 hqs. A funзгo funciona assim
pawn Код:
if(PlayerToPoint(2, playerid,957.9416,-1556.2628,13.5802))
{//ENTRADA HQ 1
GameTextForPlayer(playerid, "~w~HQ 1", 5000, 1);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,343.7183,304.9376,999.1484);
PlayerInfo[playerid][pInt] = 6;
SetPlayerVirtualWorld(playerid, 1);
}
else if(PlayerToPoint(2, playerid,-1681.4905,1350.2188,7.1722))
{//ENTRADA HQ 2
GameTextForPlayer(playerid, "~w~HQ 2", 5000, 1);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid,343.7183,304.9376,999.1484);
PlayerInfo[playerid][pInt] = 6;
SetPlayerVirtualWorld(playerid, 2);
}
Mais Matheus eu ao sair do interior eu saio no mesmo lugar da outra HQ!
Entгo й sу vocк usar a funзгo abaixo.
pawn Код:
if(PlayerToPoint(1.0, playerid,343.7183,304.9376,999.1484) && GetPlayerVirtualWorld(playerid) == 1)//Aki getara o player caso ele entra no mundo 1 ele getara para GetPlayerVirtualWorld(playerid) == 1, para verificar se o player estava no mundo 1 e setar ele na pos de entrada correta.
{//SAIDA HQ 1
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,957.9416,-1556.2628,13.5802);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pLocal] = 255;
}
else if(PlayerToPoint(1.0, playerid,343.7183,304.9376,999.1484) && GetPlayerVirtualWorld(playerid) == 2)//Aki getara o player caso ele entra no mundo 2 ele getara para GetPlayerVirtualWorld(playerid) == 2, para verificar se o player estava no mundo 2 e setar ele na pos de entrada correta.
{//SAIDA HQ 2
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,-1681.4905,1350.2188,7.1722);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pLocal] = 255;
}
Crйditos:
Matheus Vieira pelo tutorial.
Tutorial feito em resposta ao tуpico: https://sampforum.blast.hk/showthread.php?tid=324086&page=2