SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 09/01/2020, 12:31 PM   #1
iPhonee
Little Clucker
 
iPhonee's Avatar
 
Join Date: Jul 2019
Location: Brasil
Posts: 39
Reputation: 5
Question AttachTrailerToVehicle

Para usar o anexo entre um GetPlayerVehicleID(playerid)
e um trailerid qualquer mas próximo ao jogador como faz ?
exemple cod:
Code:
AttachTrailerToVehicle(trailerid, GetPlayerVehicleID(playerid));
iPhonee is offline   Reply With Quote
Old 09/01/2020, 01:38 PM   #2
Nyft
Big Clucker
 
Nyft's Avatar
 
Join Date: Dec 2019
Posts: 192
Reputation: 11
Default Re: AttachTrailerToVehicle

Explique melhor, eu entendi como colocar um trailer qualquer em um caminhão.

So criar um Veículo dps um Trailer

PHP Code:
veh CreateVehicle()
trailer CreateVehicle()

AttachTrailerToVehicle(trailerveh); 
https://wiki.sa-mp.com/wiki/AttachTrailerToVehicle

Se for outra coisa..
__________________
Nyft#0222
Nyft is offline   Reply With Quote
Old 09/01/2020, 01:39 PM   #3
iPhonee
Little Clucker
 
iPhonee's Avatar
 
Join Date: Jul 2019
Location: Brasil
Posts: 39
Reputation: 5
Default Re: AttachTrailerToVehicle

O Comando estar assim, mas nao funfa por alguma coisa errada!

Quote:
COMMAND:reatrelar(playerid, params[])
{
new trailerid = GetVehicleTrailer(playerid);
if (APlayerData[playerid][LoggedIn] == false) return 0;
if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, -1, "{ff0000}Esteja conduzindo um veículo!");
AttachTrailerToVehicle(trailerid, GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xffffffff, "{a9c4e4}Você Reatrelou a carroceria.");
return 1;
}
__________________
https://discord.gg/bP25YQm
iPhonee is offline   Reply With Quote
Old 09/01/2020, 01:41 PM   #4
iPhonee
Little Clucker
 
iPhonee's Avatar
 
Join Date: Jul 2019
Location: Brasil
Posts: 39
Reputation: 5
Default Re: AttachTrailerToVehicle

Quote:
Originally Posted by Nyft View Post
Explique melhor, eu entendi como colocar um trailer qualquer em um caminhão.

So criar um Veículo dps um Trailer

PHP Code:
veh CreateVehicle()
trailer CreateVehicle()

AttachTrailerToVehicle(trailerveh); 
https://wiki.sa-mp.com/wiki/AttachTrailerToVehicle

Se for outra coisa..
Preciso que eu conecto um reboque seja ele qual for no GetPlayerVehicleID (playerid)
__________________
https://discord.gg/bP25YQm
iPhonee is offline   Reply With Quote
Old 09/01/2020, 01:48 PM   #5
Nyft
Big Clucker
 
Nyft's Avatar
 
Join Date: Dec 2019
Posts: 192
Reputation: 11
Default Re: AttachTrailerToVehicle

Quando você 'reatrela' um veículo em um trailer não precisa de comandos, isso é padrão do gta.

Eu sei de algumas verificações com trailer:

PHP Code:
CMD:carregar(playerid)
{
    if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
        return 
SendClientMessage(playerid, -1"[ERRO] Seu veículo não está engatado.");

    if(
GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) != 435)
        return 
SendClientMessage(playerid, -1"[ERRO] Não está engatada a carga 435 em seu veículo.");

    
Carga[playerid] = true;
    
SendClientMessage(playerid, -1"[INFO] Veículo carregado.");
    return 
1;

https://wiki.sa-mp.com/wiki/IsTrailerAttachedToVehicle
https://wiki.sa-mp.com/wiki/GetVehicleTrailer
__________________
Nyft#0222
Nyft is offline   Reply With Quote
Old 09/01/2020, 01:52 PM   #6
iPhonee
Little Clucker
 
iPhonee's Avatar
 
Join Date: Jul 2019
Location: Brasil
Posts: 39
Reputation: 5
Default Re: AttachTrailerToVehicle

eu sei que é padrao do gta "voce da a ré e engatar o trailer normalmente"

mas oq eu queria era chega proximo a ele e usar o cmd "reatrelar"

assim ele auto ja engata na carga sem precisar da ré e fazer balizas.
__________________
https://discord.gg/bP25YQm
iPhonee is offline   Reply With Quote
Old 09/01/2020, 02:38 PM   #7
Nyft
Big Clucker
 
Nyft's Avatar
 
Join Date: Dec 2019
Posts: 192
Reputation: 11
Default Re: AttachTrailerToVehicle

PHP Code:
CMD:rebocar(playerid)
{
    if(
GetPlayerState(playerid) != 2)
        return 
SendClientMessage(playerid, -1"[ERRO] Você não está conduzindo um veículo.");

    new 
Float:Pos[3];
    
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);

    new 
Float:Veh[3];
    new 
Found;
    new 
vehicle;

    while((
vehicle MAX_VEHICLES) && (!Found))
    {
        
vehicle++;
        
GetVehiclePos(vehicleVeh[0], Veh[1], Veh[2]);

        if((
floatabs(Pos[0]-Veh[0]) < 7.0) && (floatabs(Pos[1]-Veh[1]) < 7.0) && (floatabs(Pos[2]-Veh[2]) < 7.0) && (vehicle != GetPlayerVehicleID(playerid)))
        {
            if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
            {
                
AttachTrailerToVehicle(vehicleGetPlayerVehicleID(playerid));
            }
        }
    }
    return 
1;

Tenta esse comando.
__________________
Nyft#0222
Nyft is offline   Reply With Quote
Old 09/01/2020, 09:23 PM   #8
iPhonee
Little Clucker
 
iPhonee's Avatar
 
Join Date: Jul 2019
Location: Brasil
Posts: 39
Reputation: 5
Default Re: AttachTrailerToVehicle

exatamente oq eu estava falando ! +rep!

Obrigado, Topico Trancado!
__________________
https://discord.gg/bP25YQm
iPhonee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help] AttachTrailerToVehicle Nedda Scripting Help 0 18/06/2014 01:36 PM
[Help] AttachTrailerToVehicle AlmirDelic Scripting Help 3 12/08/2013 03:33 PM
AttachTrailerToVehicle Buzzbomb Scripting Help 1 06/12/2012 06:59 PM
Help with AttachTrailerToVehicle.. Azzeto Scripting Help 2 01/12/2011 04:42 AM
AttachTrailerToVehicle zanakinz Help Archive 9 27/03/2009 10:05 PM


All times are GMT. The time now is 07:55 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.