SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/05/2018, 06:30 PM   #1
KamilPolska
Big Clucker
 
Join Date: May 2016
Location: Poland
Posts: 170
Reputation: 0
Default Respawn

How to make respawn of all the trailers that I created.
And the trailer should not disappear when the player is connected to the truck.
__________________
Poland / PAWN Amateur
KamilPolska is offline   Reply With Quote
Old 14/05/2018, 03:33 PM   #2
KamilPolska
Big Clucker
 
Join Date: May 2016
Location: Poland
Posts: 170
Reputation: 0
Default Re: Respawn

How to make respawn for these trailers after writing a command.
Code:
Trailer[0][ID_Trailer] = CreateVehicle(591, 1630.7227, -1089.4471, 24.5123, 269.7912, -1, -1, -1);
Trailer[1][ID_Trailer] = CreateVehicle(591, 1630.7227, -1089.4471, 24.5123, 269.7912, -1, -1, -1);
Trailer[2][ID_Trailer] = CreateVehicle(591, 1630.7227, -1089.4471, 24.5123, 269.7912, -1, -1, -1);
__________________
Poland / PAWN Amateur
KamilPolska is offline   Reply With Quote
Old 15/05/2018, 06:38 AM   #3
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 817
Reputation: 91
Default Re: Respawn

http://wiki.sa-mp.com/wiki/SetVehicleToRespawn - SetVehicleToRespawn to Respawn your vehicles.
__________________

I don't help for rep. I help cuz I was helped in the past.


California State Roleplay - X Update Now under beta testing phase. Stay Tuned.
GTLS is offline   Reply With Quote
Old 15/05/2018, 07:04 PM   #4
KamilPolska
Big Clucker
 
Join Date: May 2016
Location: Poland
Posts: 170
Reputation: 0
Default Re: Respawn

Player has a connected trailer, how to make it not respawn.
__________________
Poland / PAWN Amateur
KamilPolska is offline   Reply With Quote
Old 16/05/2018, 05:07 AM   #5
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 817
Reputation: 91
Default Re: Respawn

Then I suppose you will have to respawn the trailer manually one by one. Using their IDs. (/dl)
__________________

I don't help for rep. I help cuz I was helped in the past.


California State Roleplay - X Update Now under beta testing phase. Stay Tuned.
GTLS is offline   Reply With Quote
Old 16/05/2018, 06:27 PM   #6
KamilPolska
Big Clucker
 
Join Date: May 2016
Location: Poland
Posts: 170
Reputation: 0
Default Re: Respawn

I wanted to do CMD for unused trailers. If the player is not sitting in a trailer, then the trailer should be respawn. Just how to do it?
__________________
Poland / PAWN Amateur
KamilPolska is offline   Reply With Quote
Old 17/05/2018, 12:16 AM   #7
CyNiC
High-roller
 
Join Date: Jan 2009
Location: Brazil
Posts: 1,445
Reputation: 203
Default Re: Respawn

Code:
stock SetAllVehicleToRespawn()
{
    new trailers[MAX_VEHICLES/2];

	for(new i = 1, j; i < MAX_VEHICLES; i++)
	{
	    for(new k = 0; k < j; k++) if(i == trailers[k])   goto Continue; 

	    if(IsTrailerAttachedToVehicle(i))
		{
	        trailers[j] = GetVehicleTrailer(i);
	        j++;
	        continue;
	    }
	    SetVehicleToRespawn(i);
		Continue:
	}
}
__________________
My scripts
Brazucas'Server
CyNiC is offline   Reply With Quote
Old 17/05/2018, 10:55 AM   #8
KamilPolska
Big Clucker
 
Join Date: May 2016
Location: Poland
Posts: 170
Reputation: 0
Default Re: Respawn

<REMOVED>
__________________
Poland / PAWN Amateur

Last edited by KamilPolska; 17/05/2018 at 12:25 PM.
KamilPolska 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
Respawn Vehicles don't respawn spawned cars JaKe Elite Scripting Help 6 20/05/2013 07:17 AM
Respawn Akcent_Voltaj Scripting Help 9 21/01/2013 11:57 PM
[Ajuda] Respawn Bruno Alves Português/Portuguese 5 07/07/2012 10:46 PM
Respawn jot16 Help Archive 2 02/08/2011 06:11 AM
how to respawn the player pos ? respawn(playerid); ?[solved] AlbanianGuy Help Archive 3 24/04/2010 02:22 AM


All times are GMT. The time now is 01:09 AM.


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