Jump to content

RandomSpawns


Roach

Recommended Posts

RandomSpawns Tutorial

Astazi va voi arata in niste pasi cum sa faceti un RandomSpawn(s)!

La ce imi trebuie?

Pei dupa cum bine observati din Titlu, va veti Spawn-a in mai multe locuri, nu in acelasi de fiecare data!


Sa incepem Tutorialul!

Pas 1!

Pentru a crea un RandomSpawn trebuie sa aflam Coordonatele acelui post:

Va duceti in sa-mp , in post-urile in care vreti s va spawnati si dati /save!(fara !)

Daca ati mai salvat ceva puneti cam asa (doar daca vreti nu e neaaparat) /save RandomSpawn sau /save RS, sau cum vreti voi sa fie numele acelui post!


Pas 2!

Acum trebuie sa gasim coordonatele:

Depinde de versiunea de samp pe care o folositi:

0.2x-0.3a:

Gta San Andreas\savedposition.txt 
0.3b:
My Documents\GTA San Andreas User Files\SAMP\savedposition.txt
Deschideti savedposition.txt si veti gasi Coordonatele!
AddPlayerClass(97,1212.7212,-2034.9263,59.9254,90.2055,0,0,0,0,0,0); // RS sau RandomSpawn
AddPlayerClass(97,1243.2084,-2057.6554,60.0187,94.9352,0,0,0,0,0,0); // RS sau RandomSpawn
AddPlayerClass(97,1238.0105,-2052.6873,59.9975,2.8144,0,0,0,0,0,0); // RS sau RandomSpawn
Aceasta functie inseamna:
AddPlayerClass(skinid, x, y, z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
Pentru a afla mai multe apasa Aici
Acum sa bagam Coordonatele in GM. Nu uitati ca trebuie sa bagati doar x, y ,z si angle daca vreti, cam asa:
1212.7212,-2034.9263,59.9254,90.2055 // RS sau RandomSpawn
1243.2084,-2057.6554,60.0187,94.9352 // RS sau RandomSpawn
1238.0105,-2052.6873,59.9975,2.8144 // RS sau RandomSpawn
Dar nu asa il bagam in GM :D! Ci asa:
new Float:RandomSpawns[3][] = 
{
    {1212.7212,-2034.9263,59.9254,90.2055}, // RS sau RandomSpawn
    {1243.2084,-2057.6554,60.0187,94.9352}, // RS sau RandomSpawn
    {1238.0105,-2052.6873,59.9975,2.8144} // RS sau RandomSpawn
};
3 = Cate coordonate sunt. Coordonatele trebuiesc mereu bagate intre:
{
};

Acum sa va explic ce contine functia(coordonatele):
    {1238.0105,-2052.6873,59.9975,2.8144} // RS sau RandomSpawn
Cam asta contine:
    {x, y, z, angle} // RS sau RandomSpawn
Nu puneti niciodata "" la coordonate!
public OnPlayerSpawn(playerid)
{
    return 1;
}

Si punem:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(RandomPlayerSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    return 1;
}
Daca nu ati pus angle scoateti:
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);


Functii folosite:

SetPlayerPos: Aici

SetPlayerFacingAngle: Aici


[glow=navy,2,300]Sper ca data viitoare sa reusiti si singuri![/glow]

Pas 3!
Veti gasi ceva de genul:
Pas 4!
Acum sa facem(punem) piesa de rezistenta: Aceasta se pune la OnPlayerSpawn:

142sj0l.png

Underground-GFX

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.