Jump to content

Question

7 answers to this question

Recommended Posts

Posted

Pai, in primul rand, trebuie sa faci un stock care verifica daca jucatorul este sau nu este in zona specificata de tine.Stock-ul va arata asa:

stock IsPlayerInStreamAudioArea ( playerid )

{

    new

   

        pos [ 3 ]

;

   

    GetPlayerPos ( playerid , pos [ 0 ] , pos [ 1 ] , pos [ 2 ] ) ;

  if ( pos [ 0 ] > MINX && pos [ 0 ] < MAXX && pos [ 1 ] > MINY && pos [ 1 ] < MAXY)

   

    {

   

        return ( 1 ) ;

       

    }

   

    return ( 0 ) ;

   

}

Daca nu vrei sa folosesti stock-ul, ve-i fi obligat sa folosesti IsPlayerInRageOfPoint.Acum, ca sa verifici daca jucatorul este sau nu in zona respectiva, codul trebuie adaugat la OnPlayerUpdate si va arata cam asa:

public OnPlayerUpdate ( playerid )

{

    if ( IsPlayerInStreamAudioArea ( playerid ) )

   

    {

   

        PlayAudioStreamForPlayer ( playerid , " /* Aici trebuie trecut link-ul melodiei. */ " , /* X */ , /* Y */ , /* Z */ , /* Raza de actiune. */ , 1 ) ;

    }

    else

   

    {

        StopAudioStreamForPlayer ( playerid ) ;

    }

    return ( 1 ) ;

   

}

Posted
D:\SAMP\brigada\gamemodes\legenddead.pwn(9827) : error 010: invalid function or declaration
D:\SAMP\brigada\gamemodes\legenddead.pwn(9829) : error 055: start of function body without function header
D:\SAMP\brigada\gamemodes\legenddead.pwn(9831) : error 021: symbol already defined: "PlayAudioStreamForPlayer"
D:\SAMP\brigada\gamemodes\legenddead.pwn(9833) : error 054: unmatched closing brace ("}")
D:\SAMP\brigada\gamemodes\legenddead.pwn(9835) : error 010: invalid function or declaration
D:\SAMP\brigada\gamemodes\legenddead.pwn(9837) : error 055: start of function body without function header
D:\SAMP\brigada\gamemodes\legenddead.pwn(9839) : error 021: symbol already defined: "StopAudioStreamForPlayer"
D:\SAMP\brigada\gamemodes\legenddead.pwn(9841) : error 054: unmatched closing brace ("}")
D:\SAMP\brigada\gamemodes\legenddead.pwn(9843) : error 010: invalid function or declaration
D:\SAMP\brigada\gamemodes\legenddead.pwn(9845) : error 054: unmatched closing brace ("}")

Posted

[pawn]    if ( IsPlayerInStreamAudioArea ( playerid ) )

    {

        PlayAudioStreamForPlayer ( playerid , "http://stream.profm.ro:8012/profm.mp3" ,1576.1241,-1255.1184,277.8801,40.0, 1 ) ;

    }

    else

    {

        StopAudioStreamForPlayer ( playerid ) ;

    }

    return 1;

}[/pawn]

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.