Jump to content

[REZOLVAT] Intrebare Cum adauca masini la spawn


CRISTIANN
 Share

Recommended Posts

  • Administrator

1. Declari o variabila de tip array:

new masinaSpawn[10]; // 10 reprezentand numarul maxim de masini ce il suporta acest array.

La public-ul OnGameModeInit() adaugam urmatorul cod:

masinaSpawn[ 0 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 1 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 2 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 3 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 4 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 5 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 6 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 7 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 8 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );
masinaSpawn[ 9 ] = CreateVehicleEx( model, x, y, z, rotatie, culoare_1, culoare_2, 0 );

// CreateVehicleEx fiind un stock pe care-l regasesti in gamemode-ul Burned.

Iar la public-ul OnGameModeExit() adaugi urmatorul cod:

for(new i = 0; i < sizeof(masinaSpawn); ++i) {
    DestroyVehicleEx(masinaSpawn[i]);
}

// Acest loop e pentru distrugerea vehiculelor cand server-ul este restartat.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...