[AJUDA] sair de interiores SetPlayerVirtualWorld !!!
#1

koe galera ! ! !

entao criei 5 interiores iguais para HQ's das POLICIAS

o problema e na hora de sair q nao to conseguindo fazer com q saia no mesmo lugar q entro

Comando /entrar
pawn Код:
if(strcmp(cmd, "/entrar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerToPoint(3.0, playerid,1480.9403,-1770.8481,18.7958))
            {
                SetPlayerInterior(playerid,3);
                SetPlayerPos(playerid,387.7978,173.8582,1008.3828);
                GameTextForPlayer(playerid, "~w~Bem vindo a Prefeitura !", 5000, 1);
            }
            if (PlayerToPoint(3.0, playerid,1554.6337,-1675.5465,16.1953))
            {
                SetPlayerInterior(playerid, 6);
                SetPlayerPos(playerid, 246.7839,63.9001,1003.6406);
                GameTextForPlayer(playerid, "~w~Bem vindo a Policia Militar !", 5000, 1);
            }
            if (PlayerToPoint(3.0, playerid,2730.0149,-2451.4441,17.5937))
            {
                SetPlayerInterior(playerid, 3);
                SetPlayerPos(playerid, 288.7459,169.3509,1007.1718);
                SetPlayerVirtualWorld(playerid, 1);
                GameTextForPlayer(playerid, "~w~Bem vindo ao Exercito !", 5000, 1);
            }
            else if (PlayerToPoint(3.0, playerid,329.4018,-1513.2111,36.0391))
            {
                SetPlayerInterior(playerid, 3);
                SetPlayerPos(playerid, 288.7459,169.3509,1007.1718);
                SetPlayerVirtualWorld(playerid, 2);
                GameTextForPlayer(playerid, "~w~Bem vindo a ROTAM !", 5000, 1);
            }
            else if (PlayerToPoint(3.0, playerid,913.6578,-1003.6573,37.9989))
            {
                SetPlayerInterior(playerid, 3);
                SetPlayerPos(playerid, 288.7459,169.3509,1007.1718);
                SetPlayerVirtualWorld(playerid, 3);
                GameTextForPlayer(playerid, "~w~Bem vindo a Policia Civil !", 5000, 1);
            }
            else if (PlayerToPoint(3.0, playerid,627.6210,-571.7542,17.6218))
            {
                SetPlayerInterior(playerid, 3);
                SetPlayerPos(playerid, 288.7459,169.3509,1007.1718);
                SetPlayerVirtualWorld(playerid, 4);
                GameTextForPlayer(playerid, "~w~Bem vindo a Policia Federal !", 5000, 1);
            }
        }
        return 1;
    }
Comando /sair
pawn Код:
if(strcmp(cmd, "/sair", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                TogglePlayerControllable(playerid,1);
                RemovePlayerFromVehicle(playerid);
            }
            if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1481.2550,-1765.8638,18.7958);
            }
            if (PlayerToPoint(3.0, playerid,246.7839,63.9001,1003.6406))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1554.6337,-1675.5465,16.1953);
            }
            if (SetPlayerVirtualWorld(playerid, 1) && PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,2730.0149,-2451.4441,17.5937);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (SetPlayerVirtualWorld(playerid, 2) && PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,329.4018,-1513.2111,36.0391);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (SetPlayerVirtualWorld(playerid, 3) && PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,913.6578,-1003.6573,37.9989);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (SetPlayerVirtualWorld(playerid, 4) && PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,627.6210,-571.7542,17.6218);
                SetPlayerVirtualWorld(playerid, 0);
            }
        }
        return 1;
    }

Desde ja agradeзo a ajuda de vcs ! ! ! SZ
Reply
#2

So coloca no Comando Sair o SetPlayerVirtualWorld 0 uai...
Reply
#3

num entendi tem como esplicar melhor
Reply
#4

PHP код:
if(strcmp(cmd"/sair"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                
TogglePlayerControllable(playerid,1);
                
RemovePlayerFromVehicle(playerid);
            }
            if (
PlayerToPoint(3.0playerid,387.7978,173.8582,1008.3828))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,1481.2550,-1765.8638,18.7958);
                
SetPlayerVirtualWorld(playerid0);
            }
            if (
PlayerToPoint(3.0playerid,246.7839,63.9001,1003.6406))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,1554.6337,-1675.5465,16.1953);
                
SetPlayerVirtualWorld(playerid0);
            }
            if (
SetPlayerVirtualWorld(playerid1) && PlayerToPoint(3.0playerid,288.7459,169.3509,1007.1718))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,2730.0149,-2451.4441,17.5937);
                
SetPlayerVirtualWorld(playerid0);
            }
            else if (
SetPlayerVirtualWorld(playerid2) && PlayerToPoint(3.0playerid,288.7459,169.3509,1007.1718))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,329.4018,-1513.2111,36.0391);
                
SetPlayerVirtualWorld(playerid0);
            }
            else if (
SetPlayerVirtualWorld(playerid3) && PlayerToPoint(3.0playerid,288.7459,169.3509,1007.1718))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,913.6578,-1003.6573,37.9989);
                
SetPlayerVirtualWorld(playerid0);
            }
            else if (
SetPlayerVirtualWorld(playerid4) && PlayerToPoint(3.0playerid,288.7459,169.3509,1007.1718))
            {
                
SetPlayerInterior(playerid,0);
                
SetPlayerPos(playerid,627.6210,-571.7542,17.6218);
                
SetPlayerVirtualWorld(playerid0);
            }
        }
        return 
1;
    } 
Reply
#5

Assim..o VirtualWorld Original de todo mundo e o 0,dae no comando /sair vc coloca SetVirtualWorld para 0...
Reply
#6

ai Luнs Miki dessa forma ai eu ja tinha feito eu ja to colocando VirtualWorld 0 depois q sair o problema e esse

pawn Код:
if(strcmp(cmd, "/sair", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                TogglePlayerControllable(playerid,1);
                RemovePlayerFromVehicle(playerid);
            }
            if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1481.2550,-1765.8638,18.7958);
            }
            if (PlayerToPoint(3.0, playerid,246.7839,63.9001,1003.6406))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1554.6337,-1675.5465,16.1953);
            }
            if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,2730.0149,-2451.4441,17.5937);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,329.4018,-1513.2111,36.0391);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,913.6578,-1003.6573,37.9989);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,627.6210,-571.7542,17.6218);
                SetPlayerVirtualWorld(playerid, 0);
            }
        }
        return 1;
    }
ai como daзo para sair nos lugares certos porque todos saem no mesmo lugar
Reply
#7

vcs nгo intederam oq ele quer fazer...
eu sei oq й pq a muito tempo atraz eu fis isso ^^
vamos supor q primeiro lugar q ele entrou o virtual world й 0.
vc da um getvirtualworld e ver se for 0 ele vai para a saida q seta no virtual world 0.
vamos fazer a mesma coisa com o virtual world 1, 2, 3 e etc...
isso vc pode fazer rapido com if e else if ^^
Reply
#8

Fiz um exemplo pra vocк, leia os comentбrios .

Digamos que a "posiзгo" de que falo abaixo seja a mesma nos dois casos.


pawn Код:
else if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718) && GetPlayerVirtualWorld(playerid) == 0)//Se tiver na "posiзгo" e tiver o virtual world igual б 0
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,329.4018,-1513.2111,36.0391);//Serб mandando pra um lugar
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if (PlayerToPoint(3.0, playerid,288.7459,169.3509,1007.1718) && GetPlayerVirtualWorld(playerid) == 1)//Se tiver na "posiзгo" e tiver o virtual world igual б 1
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,913.6578,-1003.6573,37.9989);//Serб mandando pra outro lugar
                SetPlayerVirtualWorld(playerid, 0);
            }

Espero ter ajudado
Reply
#9

SALVESSSSSSSS ! ! !

Isso ai mesmo Canabis

deu certim e issso ai mesmo q eu tava tentando fazer rjjj

brigadao a todos q me ajudarao.


RESOLVIDO ! ! !
Reply
#10

de nada meu chapa ^^
se precisar de novo й so voltar
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)