Respawn Cars is partly not working
#1

pawn Код:
COMMAND:rc(playerid, params[])
{
    for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
    {
    for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
        if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
            SetVehicleToRespawn(AHouseData[HouseID][VehicleIDs][CarSlot]);
            SendClientMessage(playerid, 0xFFFFFFFF, "Vehicles has been respawned");
            return 1;
      }
  }
return 1;
}
Lemme explain:
1. Players own 2 houses (1 vehicle slots each)
2. Players buys a vehicle in the 1st house
3. Player buys a vehicle in the 2nd house
4. Player /parks the vehicle
5. Player uses /rc or respawncars
6. It only respawns the vehicles on the 1st house not the 2nd one
Reply
#2

remove return 1 line as it will stop the loop on first occurance and add sendclientmessage out side the loop
Reply
#3

Works like a charm
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)