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.

  • Similar Content

    • By TheGodfather
      Salut, am cateva obiecte pe care le iau cu tasta y si le pun pe masina, daca pun unul sau mai multe obiecte din acestea, ma urc si cobor din masina in loc sa ma dea langa usa, unde e normal ma teleporteaza aici. Nu am adaugat nimic la onplayerstatechange sau onplayerexitvehicle. Asa atasez obiectul vehicului:
      if(StartQuest2[playerid] != 0 && yz[playerid] <= 9) {
                  if(HaveGift2[playerid] == 1) {
                      new Float: Pos[3];
                      GetVehiclePos(QuestVehicle2[playerid], Pos[0], Pos[1], Pos[2]);
                      if(PlayerToPoint(5, playerid, Pos[0], Pos[1], Pos[2]))
                      {RemovePlayerAttachedObject(playerid, 0);
                       SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
                       quest2obj[yz[playerid]] = CreateDynamicObject(1463,VipPos2[yz[playerid]][0], VipPos2[yz[playerid]][1], VipPos2[yz[playerid]][2], 0.0, 0.0, 0.0);
                       AttachDynamicObjectToVehicle(quest2obj[yz[playerid]], QuestVehicle2[playerid], VipPos2[yz[playerid]][0], VipPos2[yz[playerid]][1], VipPos2[yz[playerid]][2], 0.0, 0.0, 0.0);
                       yz[playerid] = yz[playerid] + 1;
                       HaveGift2[playerid] = -1;}
                  }

       
    • Guest farse
      By Guest farse
      Caruta atasabila

      Timp de lucru: 4 minute

      Ideie:MIHAI BR

      Info: o caruta simpla a lui MIHAI BR care se ataseaza de tine..sper sa para ceva real...

      Comanda:/caruta

      Download:
      PWN
      AMX
      Mirrors:
      Download: http://mihaibr.lx.ro/caruta.pwn
      Codul: http://mihaibr.lx.ro/caruta.txt
      Imagini:



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