Cars Auto Reload
#1

hi guys , i just created a auto respawn system for the server cars , the question is , how should i do something to this system have no effect on Attached Trailers ? i mean if a player attached a trailer to his car the trailer not respawn


here is the code
Код:
	for(new i = 0; i <= MAX_VEHICLES; i++)
    {
        if(!IsValidVehicle(i))continue;
        if(!IsVehicleOccupied(i)) SetVehicleToRespawn(i);
    }
Reply
#2

https://sampwiki.blast.hk/wiki/GetVehicleTrailer
https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle

Please search before posting help request!
Reply
#3

Код:
CarRespawn()
{
	new bool:UsedVehicle[MAX_VEHICLES];
	foreach(new i: Player)
	{
		if(IsPlayerInAnyVehicle(i))
		{
			UsedVehicle[GetPlayerVehicleID(i)] = true;
   	        if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(i)))
	        {
	            new dorseid = GetVehicleTrailer(GetPlayerVehicleID(i));
				UsedVehicle[dorseid] = true;
			}
		}
	}
	for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
	{
		if(!UsedVehicle[i])
		{
			SetVehicleToRespawn(i);
		}
	}
	return 1;
}
Reply
#4

thanks worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)