Jump to content
  • 0

atasare remorca


GEORGIKAA

Question

Salut, curand am schimbat intreg sistemul de trucker iar la selectarea unei rute nu i se ataseaza remorca.. ce ii pot face?

 

case 0:
			{
				new randomix = random(sizeof(gRandomTruck));
				SetPlayerCheckpoint(playerid, gRandomTruck[randomix][0],gRandomTruck[randomix][1],gRandomTruck[randomix][2], 4.0);
				Trailer[playerid] = CreateVehicle(435, pX+6, pY+6, pZ+6, vA, -1, -1, -1, 0);
				AttachTrailerToVehicle(Trailer[playerid], JobVehicle[playerid]);
				Trailer[playerid] = 1;
				SendClientMessage(playerid, -1, "{008080}TRUCKER >>{FFFFFF} Selected category: clothes {EEC271}(skill 1). {FFFFFF}Go to the checkpoint to deliver the cargo.");
			}

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Salut @GEORGIKAA,

Pai nu e ok, pentru ca in momentul in care tu opresti jobul, acea remorca o sa trebuiasca sa fie distrusa, si in loc sa fie distrus vehiculul cu id-ul remorcii, o sa fie distrus vehiculul cu id 1 de pe server.

Iar pentru problema cu remorca, am impresia ca trebuie sa o pui intr-un timer si sa o atasezi acolo. Parca era problema asta pe sa-mp.

Mai verifica daca nu cumva resetezi si variabila JobVehicle atunci cand dai iti creaza vehiculul de la job (/work sau ce ai tu). In cazul in care iti seteaza iar id 1, stergi si de acolo.

Daca te-am ajutat =>

spacer.png

Link to comment
Share on other sites

  • 0
Acum 15 minute, shane a spus:

Mai verifica daca nu cumva resetezi si variabila JobVehicle atunci cand dai iti creaza vehiculul de la job (/work sau ce ai tu). In cazul in care iti seteaza iar id 1, stergi si de acolo.

Nu, nu am resetat-o in comanda work.

 

Acum 15 minute, shane a spus:

Iar pentru problema cu remorca, am impresia ca trebuie sa o pui intr-un timer si sa o atasezi acolo. Parca era problema asta pe sa-mp.

 

nu stiu cum as putea sa setez timerul, gen cand selecteaza ceva din dialogul ala doar atunci sa ii ataseze remorca de tir.

Link to comment
Share on other sites

  • 0

@GEORGIKAA

Daca folosesti Y_Timers, timerul arata in felul urmator:

timer Attach_Trailer[ 1000 ]( playerid, trailerid ) {
	if( !IsPlayerInVehicle( playerid, JobVehicle[ playerid ] ) ) return true;
	new Float: pX, Float: pY, Float: pZ, Float: vX, Float: vY, Float: vZ;
	GetPlayerPos( playerid, pX, pY, pZ ), GetVehiclePos( trailerid, vX, vY, vZ );
	if( ( floatabs( pX - vX ) < 100.0 ) && ( floatabs( pY - vY ) < 100.0 ) && ( floatabs( pZ - vZ ) < 100.0 ) && ( trailerid != GetPlayerVehicleID( playerid ) ) )  AttachTrailerToVehicle( trailerid, GetPlayerVehicleID( playerid ) );
	return true; }

// in dialogul tau, cand selectezi cursa, adaugi ->
defer Attach_Trailer( playerid, Trailer[ playerid ] );

Daca ai timerele default, procedezi in felul urmator:

function Attach_Trailer( playerid ) {
	if( !IsPlayerInVehicle( playerid, JobVehicle[ playerid ] ) ) return true;
	new Float: pX, Float: pY, Float: pZ, Float: vX, Float: vY, Float: vZ;
	GetPlayerPos( playerid, pX, pY, pZ ), GetVehiclePos( Trailer[ playerid ], vX, vY, vZ );
	if( ( floatabs( pX - vX ) < 100.0 ) && ( floatabs( pY - vY ) < 100.0 ) && ( floatabs( pZ - vZ ) < 100.0 ) && ( Trailer[ playerid ] != GetPlayerVehicleID( playerid ) ) )  AttachTrailerToVehicle( Trailer[ playerid ], GetPlayerVehicleID( playerid ) );
	return true; }

// in dialogul tau, cand selectezi cursa, adaugi ->
SetTimerEx( "Attach_Trailer", 1000, false, "i", playerid );

 

Edited by shane
  • Thanks 1

Daca te-am ajutat =>

spacer.png

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
Answer this question...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.