Jump to content

DisableRemoteVehicleCollisions


Gireada

Recommended Posts

Am vazut ca in ultima versiune de SA-MP, s-a lansat functia DisableRemoteVehicleCollisions, care dupa parerea mea este un pas inainte pentru serverele de stunt. Totusi nu am vazut un tutorial in care sa explice aceasta functie si cum se foloseste.

Deci:

DisableRemoteVehicleCollisions(playerid, disable); are doi parametri, unul playerid - care face referire la jucatorul caru-ia vrem sa dezactivam coliziunea vehiculului, iar al doilea disabel facand referire la statusul functiei asupra jucatorului (0 - activat, 1 - dezactivat)

Acum sa va explic cum functioneaza aceasta functie. Pentru a putea trece prin vehiculul altui jucator, tu si respectivul jucator trebuie sa aveti activata aceasta functie, astfel aceast functie nu va merge.

Va voi da un exemplu:

1. Definim o variabila  new playercol[MAX_PLAYERS];

2.La OnPlayerConnect adaugam playercol[playerid] = 0; // setam variabila la 0 pentru a reprezenta statusul functie(dezactivata)

3.Adaugam comanda

CMD:acoliziune(playerid, params[])
{
    switch(playercol[playerid])
    {
        case 0: {DisableRemoteVehicleCollisions(playerid, 1); playercol[playerid] = 1;}
        case 1: {DisableRemoteVehicleCollisions(playerid, 0); playercol[playerid] = 0;}
    }
    return 1;
}  

  Imi pare rau ca nu pot pune un videoclip, dar nu am acuma timpul disponibil.

  • Upvote 3

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

  • 3 weeks later...
2 hours ago, EnAcHe said:

Cum pot pune pe raza,ca de exemplu la spray?

 

1. Un timer sa verifice odata la 1 secunda.

2. Esti inteligent si folosesti un loop, in care verifici pozitia tuturor jucatorilor si care e in zona specificata de tine = primeste collision care nu e ,nu primeste.

 

:D

Link to comment
Share on other sites

  • 2 weeks 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.