Jump to content

Cerere Tutorial


Jomes.

Recommended Posts

Pentru inceput adaugi aceasta matrice undeva pe la inceput in gamemode-ul tau.

 

[pawn]new Float:RandomCarSpawn[][3] =
{
    {3782.6897,-1919.2844,2.2270},
    {3770.6841,-1912.3002,2.2271},
    {3777.3240,-1914.1091,2.2271},
    {3782.6748,-1913.8456,2.2271},
    {3788.4456,-1914.4016,2.2271},
    {3794.0837,-1914.7858,2.2271}
};[/pawn]

 

Aceasta matrice creeaza locatiile de spawn pentru masina. Poti sa le modifici sa le stergi sau sa adaugi. Trebuie sa fie dupa acest format [pawn]{PosX, PosY, PosZ}[/pawn]

 

Acum la on OnGameModeInit sau in comanda ta adaugi [pawn]new rand = random(sizeof(RandomCarSpawn));
CreateVehicle(411,RandomCarSpawn[rand][0],RandomCarSpawn[rand][1],RandomCarSpawn[rand][2],0,0,0,0);[/pawn]

 

[pawn]new rand = random(sizeof(RandomCarSpawn));[/pawn] Ia un numar la intamplare de la 0 la n (n este numarul de elemente din matrice).

 

[pawn]CreateVehicle(411,RandomCarSpawn[rand][0], RandomCarSpawn[rand][1], RandomCarSpawn[rand][2], 0, 0, 0, 0);[/pawn] Creeaza masina cu coordonatele de pe pozitia care a fost aleasa aleatoriu anterior de variabila rand.

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.