Jump to content

Creare Usi care se deschid automat


hopingsteam

Recommended Posts

1. Prima data vom introduce poarta !

[pawn]new poartagri;[/pawn]

- Pui unde sunt si celalalte new-uri

[pawn]poartagri = CreateObject(object_ID, closed_X, closed_Y, closed_Z, closed_rad_X, closed_rad_Y, closed_rad_Z); //Inlocuiti voi, acesta este doar un exemplu[/pawn]

2. Acum creem usa automata .

[pawn]SetTimer("VerificaPoarta",1000,true);[/pawn]

- Din cate in cate secunde daca cineva este in preajma portii (1000 - 1 sec.)

Mergeti unde aveti celalte forward-uri si puneti:

[pawn]forward VerificaPoarta();[/pawn]

Iar ceea ce este cel mai complicat, miscarea portii in sine

[pawn]public VerificaPoarta()

{

    new poartagri_status;

    for(new i;i<MAX_PLAYERS;i++)

    {

        if(!IsPlayerConnected(i)) continue;

        if(IsPlayerInRangeOfPoint(i,10.0,closed_X,closed_Y,closed_Z))poartagri_status=1;

    }

    if(poartagri_status)MoveObject(mygate, open_X, open_Y, open_Z,vdemiscare);

    else MoveObject(poartagri, closed_X, closed_Y, closed_Z, vdemiscare);

}[/pawn]

vdemiscare - viteza de miscare, o inlocuiti voi !

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.