Jump to content

Trailer


iReaLx

Recommended Posts

Nume: bEnZ
Problema: Salutare, pe gm, la jobul farmer am un trailer din ala care atunci cand dai startroute se ataseaza ala dar problema este ca la mine cand dau startroute, acel trailer cade pe langa tractor, cum naiba sa fac un timer sa se agate fix de tractor?
Imagini/Video: -
Cod Sursa:          pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
 
        AttachTrailerToVehicleEx( pTrailer[ playerid ], veh );
    }
 
        DisablePlayerCheckpoint(playerid);
 
    CP[ playerid ] = 0;
 
    SCM(playerid,-1,""GRI"Pentru a vinde sacii du-te la intrare in Burger si tasteaza /sellbags!");
 
VanzareF [ playerid ] = true;
 
if( pTrailer[ playerid ] != 0 )
 
{
 
DestroyVehicle( pTrailer[ playerid ] );
 
pTrailer[ playerid ] = 0;
 
}
}
Alte detalii: Ajutor :))
Edited by iReaLx
Link to comment
Share on other sites

Acum 5 ore, iReaLx a spus:
Nume: bEnZ
Problema: Salutare, pe gm, la jobul farmer am un trailer din ala care atunci cand dai startroute se ataseaza ala dar problema este ca la mine cand dau startroute, acel trailer cade pe langa tractor, cum naiba sa fac un timer sa se agate fix de tractor?
Imagini/Video: -
Cod Sursa:          pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
 
        AttachTrailerToVehicleEx( pTrailer[ playerid ], veh );
    }
 
        DisablePlayerCheckpoint(playerid);
 
    CP[ playerid ] = 0;
 
    SCM(playerid,-1,""GRI"Pentru a vinde sacii du-te la intrare in Burger si tasteaza /sellbags!");
 
VanzareF [ playerid ] = true;
 
if( pTrailer[ playerid ] != 0 )
 
{
 
DestroyVehicle( pTrailer[ playerid ] );
 
pTrailer[ playerid ] = 0;
 
}
}
Alte detalii: Ajutor :))

Foloseste AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleId(playerid)); in loc de

AttachTrailerToVehicleEx( pTrailer[ playerid ], veh ); 

daca nu merge iti fac si acel timer.

Link to comment
Share on other sites

27 minutes ago, valivaly96 said:

Foloseste AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleId(playerid)); in loc de

AttachTrailerToVehicleEx( pTrailer[ playerid ], veh ); 

daca nu merge iti fac si acel timer.

EDIT : Am pus ce ai zis si tot asa face, trebuie un timer ceva... tot pe langa cade

 

 

Edited by iReaLx
Link to comment
Share on other sites

Acum 12 ore, iReaLx a spus:

EDIT : Am pus ce ai zis si tot asa face, trebuie un timer ceva... tot pe langa cade

 

 

SetTimerEx("AttachTrailer",500,0,"i",platerid);//adaugi in loc de AttacheTrailerToVehicle

forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleId(playerid));

return 1;

}

Link to comment
Share on other sites

5 hours ago, valivaly96 said:

SetTimerEx("AttachTrailer",500,0,"i",platerid);//adaugi in loc de AttacheTrailerToVehicle

forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleId(playerid));

return 1;

}

            pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
              SetTimerEx("AttachTrailer",500,0,"i",playerid);
        }
        else return SCM ( playerid , -1 , ""GRI"You must be the driver to start a JOB route." ) ;
    }
    else return SCM ( playerid , -1 , IsNotAutorized ) ;
    return 1 ;
}
forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

    AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleID(playerid));

    return 1;

}

 

Am pus asa cum ai zis si degeaba, tot nu merge... tot nu se agata dupa tractor... e enervant :))

Link to comment
Share on other sites

Acum 2 ore, iReaLx a spus:

            pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
              SetTimerEx("AttachTrailer",500,0,"i",playerid);
        }
        else return SCM ( playerid , -1 , ""GRI"You must be the driver to start a JOB route." ) ;
    }
    else return SCM ( playerid , -1 , IsNotAutorized ) ;
    return 1 ;
}
forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

    AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleID(playerid));

    return 1;

}

 

Am pus asa cum ai zis si degeaba, tot nu merge... tot nu se agata dupa tractor... e enervant :))

fa un debug care sa afiseze id ul remorcii.

Unul inainte de a seta timerul, si unul cand se executa timerul.

Dupa vezi daca idurile returnate sunt identice cu cel al remorcii.

O alta problema ar fi lagul pe srv si sa se creeze mai greu de 1/2 secunde remorca si trebuie marit timerul.

Link to comment
Share on other sites

3 hours ago, valivaly96 said:

fa un debug care sa afiseze id ul remorcii.

Unul inainte de a seta timerul, si unul cand se executa timerul.

Dupa vezi daca idurile returnate sunt identice cu cel al remorcii.

O alta problema ar fi lagul pe srv si sa se creeze mai greu de 1/2 secunde remorca si trebuie marit timerul.

Frate, sunt incepator, nu stiu sa fac :))

Link to comment
Share on other sites

Acum 1 oră, iReaLx a spus:

Frate, sunt incepator, nu stiu sa fac :))

pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
    new string[10];

format(string,sizeof(string),"id: %i",pTrailer[ playerid ]);

SCM(playerid,-1,string);

          SetTimerEx("AttachTrailer",500,0,"i",playerid);
        }
        else return SCM ( playerid , -1 , ""GRI"You must be the driver to start a JOB route." ) ;
    }
    else return SCM ( playerid , -1 , IsNotAutorized ) ;
    return 1 ;
}
forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

  

format(string,sizeof(string),"id: %i",pTrailer[ playerid ]);

SCM(playerid,-1,string);

 AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleID(playerid));

    return 1;

}

pune codul acesta si vei primi 2 mesahe in chat: idurile din chat trebuie sa fie identitc cu cel al remorcii(il afii cu comanda /dl). Astept raspunsul tau sa vad ce returneaza si daca coincid.

Link to comment
Share on other sites

18 hours ago, valivaly96 said:

pTrailer[ playerid ] = CreateVehicle( 610, F_vPos[ 0 ], F_vPos[ 1 ]- 2.8200, F_vPos[ 2 ], 0.0, 0, 0, 100 );
    new string[10];

format(string,sizeof(string),"id: %i",pTrailer[ playerid ]);

SCM(playerid,-1,string);

          SetTimerEx("AttachTrailer",500,0,"i",playerid);
        }
        else return SCM ( playerid , -1 , ""GRI"You must be the driver to start a JOB route." ) ;
    }
    else return SCM ( playerid , -1 , IsNotAutorized ) ;
    return 1 ;
}
forward AttachTrailer(playerid);

public AttachTrailer(playerid)

{

  

format(string,sizeof(string),"id: %i",pTrailer[ playerid ]);

SCM(playerid,-1,string);

 AttachTrailerToVehicle(pTrailer[ playerid ],GetPlayerVehicleID(playerid));

    return 1;

}

pune codul acesta si vei primi 2 mesahe in chat: idurile din chat trebuie sa fie identitc cu cel al remorcii(il afii cu comanda /dl). Astept raspunsul tau sa vad ce returneaza si daca coincid.

https://imgur.com/a/4KhCV  Scuze de intarziere, am pus codul, l am asezat ca dadea erori, am mai creat un " new string[10] " inainte de ultimul format ca ai uitat... si uite, prima data cand am dat startroute, mi a pui trailerul in spate.. dupa, nu mi-l mai pune si isi schimba si id..

Link to comment
Share on other sites

La 15.01.2018 la 18:08, iReaLx a spus:

https://imgur.com/a/4KhCV  Scuze de intarziere, am pus codul, l am asezat ca dadea erori, am mai creat un " new string[10] " inainte de ultimul format ca ai uitat... si uite, prima data cand am dat startroute, mi a pui trailerul in spate.. dupa, nu mi-l mai pune si isi schimba si id..

Acel trailer ar trebuii sa se ataseze doar la startroute sau si in alte circumstante.(nu stiu exact cum e conceput jobul si aici pare ok codul).

Totusi ar merita incercat cu un timer de 1 sec

SetTimerEx("AttachTrailer",1000,0,"i",playerid);

  • Upvote 1
Link to comment
Share on other sites

20 minutes ago, valivaly96 said:

Acel trailer ar trebuii sa se ataseze doar la startroute sau si in alte circumstante.(nu stiu exact cum e conceput jobul si aici pare ok codul).

Totusi ar merita incercat cu un timer de 1 sec

SetTimerEx("AttachTrailer",1000,0,"i",playerid);

Merge, gata, se aseaza acum ! man, m ar mai interesa ceva... eu cand ma dau jos din tractor zice mission failed si se respawneaza tractorul dar trailerul ramane, vreau sa l fac si p ala sa dispara o daca cu tractorul

Link to comment
Share on other sites

Acum 7 ore, iReaLx a spus:

Merge, gata, se aseaza acum ! man, m ar mai interesa ceva... eu cand ma dau jos din tractor zice mission failed si se respawneaza tractorul dar trailerul ramane, vreau sa l fac si p ala sa dispara o daca cu tractorul

La OnPlayerExitVehicle da find la Mission failed si la cea care corespunde jobului de farmer Mai adaugi DestroyVehicle(pTrailer[playerid]);

Link to comment
Share on other sites

9 hours ago, valivaly96 said:

La OnPlayerExitVehicle da find la Mission failed si la cea care corespunde jobului de farmer Mai adaugi DestroyVehicle(pTrailer[playerid]);

    if(JobRoute[playerid] != -1) {
        JobRoute[playerid] = -1;
        DisablePlayerCheckpoint(playerid);
        GameTextForPlayer(playerid, "~r~mission failed!", 2000,1);
        if(JobRoute[playerid] == 4) return 1;
        SetVehicleToRespawn(vehicleid);
        if(JobRoute[playerid] == 6) {
            SetVehicleToRespawn(vehicleid);
            JobRoute[playerid] = -1;
            DisablePlayerCheckpoint(playerid);
            GameTextForPlayer(playerid, "~r~mission failed!", 2000,1);
            FarmerON [ playerid ] = false;

 

Am asa, unde adaug? ca am adaugat jos si degaba...

Link to comment
Share on other sites

if(JobRoute[playerid] != -1) {
        JobRoute[playerid] = -1;
        DisablePlayerCheckpoint(playerid);
        GameTextForPlayer(playerid, "~r~mission failed!", 2000,1);
        if(JobRoute[playerid] == 4) return 1;

        SetVehicleToRespawn(pTrailer[playerid]);
        SetVehicleToRespawn(vehicleid);
        if(JobRoute[playerid] == 6) {
            SetVehicleToRespawn(vehicleid);
            JobRoute[playerid] = -1;
            DisablePlayerCheckpoint(playerid);
            GameTextForPlayer(playerid, "~r~mission failed!", 2000,1);
            FarmerON [ playerid ] = false;

 

 

Incearca asa.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.