24.01.2019, 04:05
PHP Code:
new bool:TrailerIsFree[MAX_VEHICLES] = true;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/respawnfreetrailers", true))
{
new TrailerID = -1;
for(new i=0; i<MAX_VEHICLES;i=i+1)
{
if(IsTrailerAttachedToVehicle(i) == 1)
{
TrailerID = GetVehicleTrailer(i);
TrailerIsFree[TrailerID] = false;
}
}
for(new i=0; i<MAX_VEHICLES;i=i+1)
{
if(TrailerIsFree[i] == true)
{
SetVehicleToRespawn(i);
}
}
}
return 0;
}