[Ajuda] Como colocar mais locais
#1

Bom, estou de volta codando, fiz os interior tudo bacana e pa, porйm й o seguinte, como todos sabemos nгo existe sу um Departamento de Policia em San Andreas, fiz sу o de ls, quero saber como faz mais sem bugar o interior, tipo mesmas coordenadas o interior porйm quando sair, sai onde entrou...

Aqui estб para entrar e sair na DP de ls

PHP код:
        //Departamento de Policia  em LS
                
if(PlayerToPoint(playerid1.01555.1127, -1675.541716.1953))
        {
            
SetPlayerPos(playerid246.78399663.9001991003.640625);
            
SetPlayerInterior(playerid6);
        }
        
//Saida Departamento de Policia
        
if(PlayerToPoint(playerid2.0246.783996,63.900199,1003.640625))
        {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1555.1127, -1675.541716.1953);
        } 
Reply
#2

e sobre tua pergunta, use virtual world
Reply
#3

@Topic

Desculpa nгo explicar isso kkk, mas coloquei isso quando aperta F na posiзгo PlayerToPoint (que й na frente da dp), a minha dъvida mesmo й tipo colocar
PHP код:
        //Saida Departamento de Policia  
if(PlayerToPoint(playerid2.0246.783996,63.900199,1003.640625))  
{  
    
SetPlayerInterior(playerid0);  
    
SetPlayerPos(playeridpos); 
Aн esse if(PlayerToPoint(playerid, 2.0, 246.783996,63.900199,1003.640625)) й a coordenada dentro da dp, to querendo й tipo eu apertar F dentro da dp e sair onde eu entrei nгo em ls, sacou?
Reply
#4

Sim mano, use virtual world.
Reply
#5

Quote:
Originally Posted by Naine
Посмотреть сообщение
Sim mano, use virtual world.
Acho q saquei agora, fazer nesse estilo?

PHP код:
        //Departamento de Policia
        
if(PlayerToPoint(playerid1.01555.1127, -1675.541716.1953))
        {
            
SetPlayerVirtualWorld(playerid3);
            
SetPlayerPos(playerid246.78399663.9001991003.640625);
            
SetPlayerInterior(playerid6);
        }
        
//Saida Departamento de Policia
        
if(PlayerToPoint(playerid2.0246.783996,63.900199,1003.640625))
        {
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1555.1127, -1675.541716.1953);
        } 
Reply
#6

Quote:
Originally Posted by WalterSantos
Посмотреть сообщение
Acho q saquei agora, fazer nesse estilo?

PHP код:
        //Departamento de Policia
        
if(PlayerToPoint(playerid1.01555.1127, -1675.541716.1953))
        {
            
SetPlayerVirtualWorld(playerid3);
            
SetPlayerPos(playerid246.78399663.9001991003.640625);
            
SetPlayerInterior(playerid6);
        }
        
//Saida Departamento de Policia
        
if(PlayerToPoint(playerid2.0246.783996,63.900199,1003.640625))
        {
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1555.1127, -1675.541716.1953);
        } 
por exemplo.. em cada interior voce coloca um virtual world diferente.. ai pra saber em qual lugar o jogador sera colocado quando sair.. basta verificar o virtual world

eu te recomendo criar um sisteminha de entradas ao inves de fazer tudo isso manualmente
Reply
#7

Hmmmm, vou procurar por alguns tutoriais, no mais... Obrigado.
Reply
#8

Quote:
Originally Posted by WalterSantos
Посмотреть сообщение
Hmmmm, vou procurar por alguns tutoriais, no mais... Obrigado.
PHP код:
#include a_samp
#define DOOR_LIMIT 10
enum e_DOOR_DATA
{
    
Float:DOOR_ENTRY[3],
    
Float:DOOR_EXIT[3],
    
DOOR_INTERIOR
}
new 
Door[DOOR_LIMIT][e_DOOR_DATA];
new 
gDoorIndex;
public 
OnGameModeInit()
{
    
// entrada_x, entrada_y, entrada_z, saida_x, saida_y, saida_z, interior
    
    // db de ls
    
Door_Create(1555.1127, -1675.541716.1953246.783996,63.900199,1003.6406256);
    return 
true;
}
stock Door_Create(Float:entry_xFloat:entry_yFloat:entry_zFloat:exit_xFloat:exit_yFloat:exit_zinterior)
{
    if(
DOOR_LIMIT <= gDoorIndex)
        return -
1;
    
Door[gDoorIndex][DOOR_ENTRY][0] = entry_x;
    
Door[gDoorIndex][DOOR_ENTRY][1] = entry_y;
    
Door[gDoorIndex][DOOR_ENTRY][2] = entry_z;
    
Door[gDoorIndex][DOOR_EXIT][0] = exit_x;
    
Door[gDoorIndex][DOOR_EXIT][1] = exit_y;
    
Door[gDoorIndex][DOOR_EXIT][2] = exit_z;
    
Door[gDoorIndex][DOOR_INTERIOR] = interior;
    return (
gDoorIndex++);
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys 16)
    {
        for(new 
0gDoorIndexi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.0Door[i][DOOR_ENTRY][0], Door[i][DOOR_ENTRY][1], Door[i][DOOR_ENTRY][2]))
            {
                
SetPlayerPos(playeridDoor[i][DOOR_EXIT][0], Door[i][DOOR_EXIT][1], Door[i][DOOR_EXIT][2]);
                
SetPlayerInterior(playeridDoor[i][DOOR_INTERIOR]);
                
SetPlayerVirtualWorld(playeridi);
                break;
            }
        }
        for(new 
0gDoorIndexi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.0Door[i][DOOR_EXIT][0], Door[i][DOOR_EXIT][1], Door[i][DOOR_EXIT][2]))
            {
                if(
GetPlayerVirtualWorld(playerid) != i)
                    continue;
                
SetPlayerPos(playeridDoor[i][DOOR_ENTRY][0], Door[i][DOOR_ENTRY][1], Door[i][DOOR_ENTRY][2]);
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
                break;
            }
        }
    }
    return 
true;

assim seria mais simples.. fiz rapidao aqui.. ve se funciona e se resolve teu problema.

(nгo testei in-game, nem compilei)
Reply
#9

Quote:
Originally Posted by Naine
Посмотреть сообщение
PHP код:
#include a_samp
#define DOOR_LIMIT 10
enum e_DOOR_DATA
{
    
Float:DOOR_ENTRY[3],
    
Float:DOOR_EXIT[3],
    
DOOR_INTERIOR
}
new 
Door[DOOR_LIMIT][e_DOOR_DATA];
new 
gDoorIndex;
public 
OnGameModeInit()
{
    
// entrada_x, entrada_y, entrada_z, saida_x, saida_y, saida_z, interior
    
    // db de ls
    
Door_Create(1555.1127, -1675.541716.1953246.783996,63.900199,1003.6406256);
    return 
true;
}
stock Door_Create(Float:entry_xFloat:entry_yFloat:entry_zFloat:exit_xFloat:exit_yFloat:exit_zinterior)
{
    if(
DOOR_LIMIT <= gDoorIndex)
        return -
1;
    
Door[gDoorIndex][DOOR_ENTRY][0] = entry_x;
    
Door[gDoorIndex][DOOR_ENTRY][1] = entry_y;
    
Door[gDoorIndex][DOOR_ENTRY][2] = entry_z;
    
Door[gDoorIndex][DOOR_EXIT][0] = exit_x;
    
Door[gDoorIndex][DOOR_EXIT][1] = exit_y;
    
Door[gDoorIndex][DOOR_EXIT][2] = exit_z;
    
Door[gDoorIndex][DOOR_INTERIOR] = interior;
    return (
gDoorIndex++);
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys 16)
    {
        for(new 
0gDoorIndexi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.0Door[i][DOOR_ENTRY][0], Door[i][DOOR_ENTRY][1], Door[i][DOOR_ENTRY][2]))
            {
                
SetPlayerPos(playeridDoor[i][DOOR_EXIT][0], Door[i][DOOR_EXIT][1], Door[i][DOOR_EXIT][2]);
                
SetPlayerInterior(playeridDoor[i][DOOR_INTERIOR]);
                
SetPlayerVirtualWorld(playeridi);
                break;
            }
        }
        for(new 
0gDoorIndexi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.0Door[i][DOOR_EXIT][0], Door[i][DOOR_EXIT][1], Door[i][DOOR_EXIT][2]))
            {
                if(
GetPlayerVirtualWorld(playerid) != i)
                    continue;
                
SetPlayerPos(playeridDoor[i][DOOR_ENTRY][0], Door[i][DOOR_ENTRY][1], Door[i][DOOR_ENTRY][2]);
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
                break;
            }
        }
    }
    return 
true;

assim seria mais simples.. fiz rapidao aqui.. ve se funciona e se resolve teu problema.

(nгo testei in-game, nem compilei)
Esse jeito buga vou da um exemplo se eu criar uma entrada e ela for ID 5 do VW e eu criar outro cmd e por SetPlayerVirtualWorld com o id 5 ele vai sair e entrar em outro lugar igual acontece nessas GM de rpg.

Isso aconteceu comigo em varios sv que usa esse sistema ai por exemplo uma vez eu estava em uma loja de utilitarios ai eu sai e fui parar na saida da agкncia.
Reply
#10

Quote:
Originally Posted by C4rtm4n
Посмотреть сообщение
Esse jeito buga vou da um exemplo se eu criar uma entrada e ela for ID 5 do VW e eu criar outro cmd e por SetPlayerVirtualWorld com o id 5 ele vai sair e entrar em outro lugar igual acontece nessas GM de rpg.
mas pq diabos tu vai alterar o virtual world de um jogador? nгo й necessario.. se o cara entrar num interior tu vai chegar la e mudar o vw dele? pq ? nao precisa cara, nao precisa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)