Jump to content
  • 0

Problema Radio!


Pinki950

Question

Am o problema in loc sa cante radioul in zona respectiva x, y, z imi face spam de "N" ori cu radioul!

Ex: PlayAudioStream http....

PlayAudioStream http....

PlayAudioStream http....

PlayAudioStream http....

[pawn]public OnPlayerUpdate( playerid )

{

new

bool: bPlay = false;

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

{

    if( IsPlayerInRangeOfPoint( i, 7.0, -2293.3921, -1632.9829, 485.1299) && bPlay == false )

    {

        bPlay = true;

        PlayAudioStreamForPlayer( i, "http://www.radiowish.ro/live.m3u" );

}

else if( bPlay == true )

{

StopAudioStreamForPlayer( i );

bPlay = false;

}

}

return 1;

}[/pawn]

?q=192&s=s&bg1=5eeb06&bg2=3a7bfc&t=000&gl=fff&b=000000&gbg=000
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Buna seara Pinki

Intrebarea mea este de ce toti va complicati cu aceste radio-uri implementate cu OnPlayerUpdate si "other stuff".Pentru evitarea de buguri si pentru crearea unui sistem simplu de radio folositi cele cu dialog.Este acelasi lucru dar parerea mea este ca sunt mult mai sigure si coordonate.Daca doresti sa te ajut sa creezi un asemenea dialog cu tot ce trebuie pentru pornirea unui radio lasa un coment aici iar eu voi incepe sa iti explic pas cu pas.

Sper ca ti-am fost de folos si vei dorii acest lucru,

[Pawn]

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

Link to comment
Share on other sites

Buna seara si ma scuzati de "Double Post" !

Am creat un tutorial pentru adaugarea unui sistem de radio pe server.Sper sa te ajute si mult succes !

http://www.sa-mp.ro/forum/index.php?topic=29915.0

Sper ca ti-am fost de folos,

[Pawn]

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

Link to comment
Share on other sites

Se creaza acel spam pentru ca ai pus codul la OnPlayerUpdate(acesta cred ca face peste 50 de verificari pe secunda)

Iar de fiecare data cand se face verificarea iar acel player este in acea zona,va porni muzica din nou si din nou.

O rezolvare ar fi urmatoarea:

Sa creezi un timer,care sa verifice daca este in acea zona,iar cand este in acea zona,sa porneaza muzica iar apoi distrugi timer-ul.

Iar cand iese din acea zona,timerul sa porneasca.

Massari e curva mea

Link to comment
Share on other sites

Buna ziua Pinki

In urma cererii tale legata de un exemplu privind SetTimer si KillTimer iti voi da mai jos un exemplu dupa care ar trebuii sa il urmezi.Acesta este doar un exemplu :

SetTimer SYNTAX:

[pawn]timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )[/pawn]

SetTimer :Exemplu

[pawn]function mainFunction()

        outputChatBox ("Instant text!")

setTimer ( function()

outputChatBox ( "5 second" )

end, 5000, 1 )

end

mainFunction() --call function[/pawn]

KillTimer SYNTAX:

[pawn]bool killTimer ( timer theTimer )[/pawn]

KillTimer EXEMPLU:

[pawn]local Timer = setTimer ( function ( ) outputChatBox ( 'TEXTUL TAU AICI' ) end, 60000, 0 )

-- Check the timer then kill the timer

if isTimer ( Timer ) then killTimer ( Timer ) end[/pawn]

Sper ca ti-am fost de folos,

[Pawn]

P.S:Sper ca iti vei da seama singur ce va trebuii sa faci.Asa inveti !

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

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.