SA-MP Forums Archive
[Ajuda] Criando veiculos em interiores - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Criando veiculos em interiores (/showthread.php?tid=569598)



Criando veiculos em interiores - MarlboroBr - 01.04.2015

Falae galera. Bom estou com mais um problema que й o seguinte. Quando eu crio veнculo no interior no comando "/criarveiculo" aparece o veнculo de boa, pois ja adaptei....

Mais eu estou querendo criar uns eventos em interiores, porem o veнculo estб ficando invisivel, eu tentei umas soluзгo aqui mais nгo consegui. Acho que este й de fato o ultimo problema que estou tendo. Obrigado ! Atй +

PHP код:
if( GetPVarInt( playerid, "pDono" ) == 1 || GetPVarInt( playerid, "pAdmin" ) == 1 )
{
    if( !
strcmp( cmd, "/ecv", true ))
    {
        if( 
VeiculosEvento == MAX_VEH_EVENTO )
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Foi excedido o limite de veнculos por evento ! ( Mбximo: 50 )" );
            return 
1;
        }
        
tmp = strtok( cmdtext, idx );
        if( !
strlen( tmp ))
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /ecv [ VeiculoID ]" );
            return 
1;
        }
        new
        
veiculoID = strval( tmp )
        ;
        if( 
veiculoID < 400 || veiculoID > 611 )
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] ID de veнculo inexistente!" );
            return 
1;
        }
        new
        
Float:ev_x, Float:ev_y, Float:ev_z, Float:ev_a
        
;
        
GetPlayerFacingAngle( playerid, ev_a );
        
GetPlayerPos( playerid, ev_x, ev_y, ev_z );
        
LinkVehicleToInterior( vehid, GetPlayerInterior( playerid ));
        new
        
ev_c = random( 360 )
        ;
        
PutPlayerInVehicle( playerid, vEvento[ VeiculosEvento ] = CreateVehicle( veiculoID, ev_x, ev_y, ev_z, ev_a, ev_c, ev_c, -1 ), 0 );
        
ivEvento[ vEvento[ VeiculosEvento ] ] = 1;
        
VeiculosEvento ++;
        return 
1;
    } 



Re: Criando veiculos em interiores - admantis - 01.04.2015

Й possнvel que vocк nгo tenha definido o virtualworld usando SetVehicleVirtualWorld. Confira neste link:
https://sampwiki.blast.hk/wiki/SetVehicleVirtualWorld

Eu sugiro fortemente a ler a lista de funзхes de script e tentar resolver os problemas por si mesmo...
https://sampwiki.blast.hk/wiki/Category:Scripting_Functions

Alйm disso, vocк muda o virtual-world quando o veнculo nao ou sido criado (a linea LinkVehicleToInterior й antes que CreateVehicle). Vocк atй mesmo ler o seu prуprio cуdigo?

Fazк-lo assim:
PHP код:
if( GetPVarInt( playerid, "pDono" ) == 1 || GetPVarInt( playerid, "pAdmin" ) == 1 )
{
    if( !
strcmp( cmd, "/ecv", true ))
    {
        if( 
VeiculosEvento == MAX_VEH_EVENTO )
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Foi excedido o limite de veнculos por evento ! ( Mбximo: 50 )" );
            return 
1;
        }
        
tmp = strtok( cmdtext, idx );
        if( !
strlen( tmp ))
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /ecv [ VeiculoID ]" );
            return 
1;
        }
        new
        
veiculoID = strval( tmp )
        ;
        if( 
veiculoID < 400 || veiculoID > 611 )
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] ID de veнculo inexistente!" );
            return 
1;
        }
        new
        
Float:ev_x, Float:ev_y, Float:ev_z, Float:ev_a
        
;
        
GetPlayerFacingAngle( playerid, ev_a );
        
GetPlayerPos( playerid, ev_x, ev_y, ev_z );
        
        new
        
ev_c = random( 360 )
        ;
        
PutPlayerInVehicle( playerid, vEvento[ VeiculosEvento ] = CreateVehicle( veiculoID, ev_x, ev_y, ev_z, ev_a, ev_c, ev_c, -1 ), 0 );
        
LinkVehicleToInterior( vEvento[ VeiculosEvento ], GetPlayerInterior( playerid ));
        
SetVehicleVirtualWorld( vEvento[ VeiculosEvento ], GetPlayerVirtualWorld( playerid ));
        
ivEvento[ vEvento[ VeiculosEvento ] ] = 1;
        
VeiculosEvento ++;
        return 
1;
    }
} 



Re: Criando veiculos em interiores - MarlboroBr - 01.04.2015

Pow mano deu certo, porem й foda criar evento em interior, a pessoa vai participar do evento e cai... Obrigado por ajudar, mais nгo й uma boa nгo. Melhor criar o veнculo e trazer os players mesmo ^^

+rep