[Ajuda] Sobre World
#1

Oie


Eu Gostaria De Arrumar Isso !

Eu Fiz 109 Entradas, Como Vocкs Podem Ver No SetPlayerVirtualWorld Eu Coloquei "1" , intao eu fiz "1 a 109"

Segue a Abaixo Algumas Entradas !
pawn Код:
if(strcmp(cmdtext, "/Entrar", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1555.5046, -1675.6525, 16.1953))
        {//Entrada Policia Militar
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Militar ", 5000, 1);
        SetPlayerInterior(playerid, 6);
        SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 1);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 325.4222,-1514.9178,36.0325))
        {//Entrada B.O.P.E
        GameTextForPlayer(playerid, "~b~DP ~w~B.O.P.E", 5000, 1);
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid,246.375991,109.245994,1003.218750);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 2);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -516.1125,-539.2328,25.5234))
        {//Entrada Policia Federal
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Federal", 5000, 1);
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid,322.197998,302.497985,999.148437);
        SetPlayerInterior(playerid, 5);
        SetPlayerVirtualWorld(playerid, 3);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 919.4677,-1252.2434,16.2109))
        {//Entrada Policia Civil
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Civil", 5000, 1);
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid,288.745971,169.350997,1007.171875);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 4);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1374.1147,404.9474,19.9555))
        {//Entrada Interpol
        GameTextForPlayer(playerid, "~b~DP ~w~Interpol", 5000, 1);
        SetPlayerInterior(playerid, 18);
        SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
        SetPlayerInterior(playerid, 18);
        SetPlayerVirtualWorld(playerid, 5);
        }
Ate Ai Tudo Bem (Eu Acho) , Agora Quero a Saida Mais Como Tem Interiores repetidos eu saio em outro lugar ex:


eu entro num loja de arma em ls e entro dentro do interior correto e quando vou sair, eu saio numa loja de arma em sf e quando entro na loja de arma de sf eu entro no interior e saio normalmente !


pawn Код:
if(strcmp(cmdtext, "/Sair", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 246.783996,63.900199,1003.640625))
        {//Saida Policia Militar
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Militar ", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,1555.5046, -1675.6525, 16.1953);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 246.375991,109.245994,1003.218750))
        {//Saida B.O.P.E
        GameTextForPlayer(playerid, "~b~DP ~w~B.O.P.E", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,325.4222,-1514.9178,36.0325);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 322.197998,302.497985,999.148437))
        {//Saida Policia Federal
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Federal", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,-516.1125,-539.2328,25.5234);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 288.745971,169.350997,1007.171875))
        {//Saida Policia Civil
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Civil", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,919.4677,-1252.2434,16.2109);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1710.433715,-1669.379272,20.225049))
        {//Saida Interpol
        GameTextForPlayer(playerid, "~b~DP ~w~Interpol", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,1374.1147,404.9474,19.9555);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }

Intao Eu Quero Entra Na Loja De Arma De Ls, e Sair Em LS

Na Loja De Arma De SF , Quero Sair Em SF.




Podem Me AJudar ? [+Resp]

Obrigado Desde Jб !
Reply
#2

faзa uma variavel para saber onde ele entrou e ao sair chama ela para saber onde o colocar.
Reply
#3

Podi Dar Um Exemplo ?
Reply
#4

pawn Код:
new NaDP[MAX_PLAYERS] = 0;


// ao entrar em LS
NaDP[playerid] = 1;

// ao entrar em LV

NaDP[playerid] = 2;


// ao sair

switch(NaDP[playerid])
{
    case 1: // set pos 1
    case 2: // set pos 2
}
ve se entende.
Reply
#5

PHP код:
new entropolial[MAX_PLAYER];

    if(
strcmp(cmdtext"/Entrar"true) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.01555.5046, -1675.652516.1953))
        {
//Entrada Policia Militar
            
entropolicial[playerid] = 1;
            
GameTextForPlayer(playerid"~b~DP ~w~Policia Militar "50001);
            
SetPlayerInterior(playerid6);
            
SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
            
SetPlayerInterior(playerid6);
            
SetPlayerVirtualWorld(playerid1);
        }
    }
    
    if(
strcmp(cmdtext"/Sair"true) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0246.783996,63.900199,1003.640625))
        {
//Saida Policia Militar
            
if(entropolicial[playerid] == 1)
            {
                   
GameTextForPlayer(playerid"~b~DP ~w~Policia Militar "50001);
                   
entropolicial[playerid] = 0;
                
SetPlayerInterior(playerid0);
                
SetPlayerPos(playerid,1555.5046, -1675.652516.1953);
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
            }
        }
    } 
Reply
#6

Nгo hб necessidade de usar tantos VirtualWorlds.
Vocк sу precisa usar um diferente caso vocк queira que dois jogadores que estejam no mesmo ambiente nгo se vejam.

Pra facilitar, use GetPlayerVirtualWorld.

Caso seja 1, o jogador sai em determinada posiзгo.
Caso seja 2, o jogador sai em determinada posiзгo.
E assim por diante
Reply
#7

pawn Код:
if(strcmp(cmdtext, "/Entrar", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1555.5046, -1675.6525, 16.1953))
        {//Entrada Policia Militar
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Militar ", 5000, 1);
        SetPlayerInterior(playerid, 6);
        SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 1);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 325.4222,-1514.9178,36.0325))
        {//Entrada B.O.P.E
        GameTextForPlayer(playerid, "~b~DP ~w~B.O.P.E", 5000, 1);
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid,246.375991,109.245994,1003.218750);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 2);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -516.1125,-539.2328,25.5234))
        {//Entrada Policia Federal
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Federal", 5000, 1);
        SetPlayerInterior(playerid, 5);
        SetPlayerPos(playerid,322.197998,302.497985,999.148437);
        SetPlayerInterior(playerid, 5);
        SetPlayerVirtualWorld(playerid, 3);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 919.4677,-1252.2434,16.2109))
        {//Entrada Policia Civil
        GameTextForPlayer(playerid, "~b~DP ~w~Policia Civil", 5000, 1);
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid,288.745971,169.350997,1007.171875);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 4);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1374.1147,404.9474,19.9555))
        {//Entrada Interpol
        GameTextForPlayer(playerid, "~b~DP ~w~Interpol", 5000, 1);
        SetPlayerInterior(playerid, 18);
        SetPlayerPos(playerid,1710.433715,-1669.379272,20.225049);
        SetPlayerInterior(playerid, 18);
        SetPlayerVirtualWorld(playerid, 5);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2440.6763,-1517.3083,23.9954))
        {//Entrada PCC
        GameTextForPlayer(playerid, "~b~HQ ~w~PCC ", 5000, 1);
        SetPlayerInterior(playerid, 8);
        SetPlayerPos(playerid,2365.2134,-1135.5975,1050.8826);
        SetPlayerInterior(playerid, 8);
        SetPlayerVirtualWorld(playerid, 6);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 691.5787,-1275.9244,13.5607))
        {//Entrada Yakuza
        GameTextForPlayer(playerid, "~b~HQ ~w~Yakuza", 5000, 1);
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid,-2169.7590,645.5231,1057.5938);
        SetPlayerInterior(playerid, 1);
        SetPlayerVirtualWorld(playerid, 7);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 776.3509,-1036.2004,24.2736))
        {//Entrada Comando Vermelho
        GameTextForPlayer(playerid, "~b~HQ ~w~Comando Vermelho", 5000, 1);
        SetPlayerInterior(playerid, 6);
        SetPlayerPos(playerid,2308.5269,-1211.2737,1049.0234);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 8);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -86.1556,2.5869,3.1172))
        {//Entrada Taliban
        GameTextForPlayer(playerid, "~b~HQ ~w~Taliban", 5000, 1);
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid,244.411987,305.032989,999.148437);
        SetPlayerInterior(playerid, 1);
        SetPlayerVirtualWorld(playerid, 9);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 933.0014,-927.6544,42.6016))
        {//Entrada Cosa Nostra
        GameTextForPlayer(playerid, "~b~HQ ~w~Cosa Nostra", 5000, 1);
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid,-2636.8501,1405.0787,906.4609);
        SetPlayerInterior(playerid, 3);
        SetPlayerVirtualWorld(playerid, 10);
        }
        //
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2322.7817,-1273.5804,22.5000))
        {//Entrada Hitmans
        GameTextForPlayer(playerid, "~b~HQ ~w~Hitmans ", 5000, 1);
        SetPlayerInterior(playerid, 6);
        SetPlayerPos(playerid,345.0741,305.5558,999.1484);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 11);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1173.7439,-964.1605,42.9375))
        {//Entrada Los Aztecas
        GameTextForPlayer(playerid, "~b~HQ ~w~Los Aztecas", 5000, 1);
        SetPlayerInterior(playerid, 8);
        SetPlayerPos(playerid,2807.8213,-1173.5691,1025.5703);
        SetPlayerInterior(playerid, 8);
        SetPlayerVirtualWorld(playerid, 12);
        }
Man Mais Olha Sгo 109 Entradas Vou Ter Que Apagar Tudo e Fazer Denovo ?
Reply
#8

Melhor sofrer um pouco, mas aprender da forma certa

Posta uns 3 aн, que te ajudo a melhorar o cуdigo.

Daн vocк faz os outros
Reply
#9

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 364.9257,-11.7908,1001.8516))
        {//Saida Cluckin Bell
        GameTextForPlayer(playerid, "~w~Cluckin Bell ", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,-2155.2839,-2460.1238,30.8516);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 381.169189,-188.803024,1000.632812))
        {//Saida Casa De Rosquinhas Jim Ring
        GameTextForPlayer(playerid, "~w~Casa De Rosquinhas Jim Ring ", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,1038.1412,-1340.7286,13.7451);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -25.884498,-185.868988,1003.546875))
        {//Saida Mercadinho Diamante
        GameTextForPlayer(playerid, "~w~Mercadinho Diamante ", 5000, 1);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid,1315.5116,-897.6838,39.5781);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        }
Reply
#10

Quote:
Originally Posted by yNexus
Посмотреть сообщение
PHP код:
new entropolial[MAX_PLAYER];
    if(
strcmp(cmdtext"/Entrar"true) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.01555.5046, -1675.652516.1953))
        {
//Entrada Policia Militar
            
entropolicial[playerid] = 1;
            
GameTextForPlayer(playerid"~b~DP ~w~Policia Militar "50001);
            
SetPlayerInterior(playerid6);
            
SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
            
SetPlayerInterior(playerid6);
            
SetPlayerVirtualWorld(playerid1);
        }
    }
    
    if(
strcmp(cmdtext"/Sair"true) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0246.783996,63.900199,1003.640625))
        {
//Saida Policia Militar
            
if(entropolicial[playerid] == 1)
            {
                   
GameTextForPlayer(playerid"~b~DP ~w~Policia Militar "50001);
                   
entropolicial[playerid] = 0;
                
SetPlayerInterior(playerid0);
                
SetPlayerPos(playerid,1555.5046, -1675.652516.1953);
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
            }
        }
    } 
Se Caso Eu Add Mais Interiores Eu Faзo Como?
pawn Код:
SetPlayerVirtualWorld(playerid, 1);
SetPlayerVirtualWorld(playerid, 2);
SetPlayerVirtualWorld(playerid, 3);
SetPlayerVirtualWorld(playerid, 4);
SetPlayerVirtualWorld(playerid, 5);
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)