Jump to content
  • 0

Question

Posted

Problemă întâlnită (descriere): Am creat un checkpoint si cand intru in el trebuie sa-mi creeze o remorca si sa o ataseza la tirul meu.
O creaza dar nu o ataseaza.
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul: [pawn]else if(CP[playerid] == 98) // trucker 2
{
   new idcar = GetPlayerVehicleID(playerid);
TrailerTruck[playerid] = AddStaticVehicleEx(591, 1409.1608,1023.9779,11.8518, 0.0, 3, 3,RESPAWN_TIME);
AttachTrailerToVehicle(TrailerTruck[playerid], idcar);
CP[playerid] = 82;
SetPlayerCheckpoint(playerid, 1087.6589,1235.6068,11.8269, 4.0);
 
}[/pawn]
Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: Da

8 answers to this question

Recommended Posts

Posted (edited)

[pawn] else if(CP[playerid] == 98) // trucker 2
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
TrailerTruck[playerid] = AddStaticVehicleEx(591, X+2, Y+2, Z, 0.0, 183, 3,RESPAWN_TIME);

SetTimerEx("AttachTrailer", 1000, false, "ii", TrailerTruck[playerid], idcar);
CP[playerid] = 82;
SetPlayerCheckpoint(playerid, 1087.6589,1235.6068,11.8269, 4.0);
}

 

 

forward AttachTrailer(trailer, car);

public AttachTrailer(trailer, car)

{

AttachTrailerToVehicle(trailer, car);

return 1;

}[/pawn]

 

Nu stiu sigur daca merge, doar presupun. Am mai avut probleme de genu si le-am rezolvat adaugand un timer. Astept un raspuns.

Edited by Iulian
  • Upvote 1

Rate me :)

Posted
else if(CP[playerid] == 98) // trucker 2
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if(IsPlayerInVehicle(playerid, vehicleid))
	{
		AttachTrailerToVehicle(trailerid, vehicleid);
		CP[playerid] = 82;
		SetPlayerCheckpoint(playerid, 1087.6589,1235.6068,11.8269, 4.0);
	}
}

"Mulţi programatori buni fac programare nu pentru că se aşteaptă să câştige bani sau să fie lăudaţi de public, ci pentru că e amuzant să programezi." - Linus Torvalds

Posted
else if(CP[playerid] == 98) // trucker 2
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if(IsPlayerInVehicle(playerid, vehicleid))
	{
		AttachTrailerToVehicle(trailerid, vehicleid);
		CP[playerid] = 82;
		SetPlayerCheckpoint(playerid, 1087.6589,1235.6068,11.8269, 4.0);
	}
}

Nu are sens ce ai scris tu mai sus... Problema lui este ca trailerul nu se ataseaza, iar tu revii cu o functie "IsPlayerInVehicle", chiar nu are sens.

 

Rate me :)

Posted

Ca sa revenim la subiect, ca sa atasezi remorca de camion. Remorca trebuie sa fie Streamed(adica sa o vezi) cu cat esti mai aproape de ea cu atat e mai bine.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted (edited)

[pawn]else if(CP[playerid] == 98) // trucker 2
{
       new idcar = GetPlayerVehicleID(playerid);

      new Float:X, Float:Y, Float:Z;

      GetPlayerPos(playerid, X, Y, Z);
      TrailerTruck[playerid] = AddStaticVehicleEx(591, X+2, Y+2, Z, 0.0, 3, 3,RESPAWN_TIME);
      AttachTrailerToVehicle(TrailerTruck[playerid], idcar);
      CP[playerid] = 82;
      SetPlayerCheckpoint(playerid, 1087.6589,1235.6068,11.8269, 4.0);
}[/pawn]

 

S-ar putea sa se spawneze putin ciudat, mai joaca-te tu cu X si Y (editeaza +2-ul ala de la AddStaticVehicleEx, astfel in cat sa se spawneze ok)

Edited by Iulian
  • Upvote 1

Rate me :)

Guest
This topic is now closed to further replies.
×
×
  • 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.