Jump to content

Recommended Posts

Posted

In loc de X, Y, Z pui coordonatele zonei.

[pawn]

public OnPlayerUpdate( playerid )

{

new

bool: bPlay = false;

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

{

    if( IsPlayerInRangeOfPoint( i, 7.0, X, Y, Z ) && bPlay == false )

    {

        bPlay = true;

        PlayAudioStreamForPlayer( i, "url" );

}

else if( bPlay == true )

{

StopAudioStreamForPlayer( i );

bPlay = false;

}

   

}

return 1;

}

[/pawn]

EDIT:

Acum mi-am dat seama, variabila bPlay creazo inafara callback-ului OnPlayerUpdate.

Daca o lasi cum am facut la inceput, serverul va incerca sa o creeze de fiecare data cand este executat OnPlayerUpdate, adica odata la cateva milisecunde.

Just Rock

Guest
This topic is now closed to further replies.
  • 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.