Wysłany: 2014-02-21, 12:39
PePPaPyT
Świat Życia
Wiek: 32 Na forum: 6375 dni Posty: 55
Nick w MP: Roger_Crotty
Piwa : 551
Witajcie, to znowu ja, teraz mam problem ze stref?, chc? zrobi? aby w danym miejscu w??cza?o si? radio, a w nast?pnym miejscu je wy??cza?o, ju? kiedy? to zrobi?em ale nie pami?tam jak.
Mam taki kod:
Kod: SetTimer("klubmuza", 1000, 1);
w OnGameModeInit
i dalej:
Kod:
forward klubmuza();
public klubmuza()
{
for(new i=0, g=GetMaxPlayers(); i<g; i++)
{
if(!IsPlayerConnected(i))
continue;
if(IsPlayerInArea(i, 494.5629, 491.5821, -22.8813, -24.9576))
{
PlayAudioStreamForPlayer(i, "http://polskastacja.pl/play/aac_clubhits.pls");
SendClientMessage(i, KOLOR_BORDOWY, "Witaj w klubie.");
}
}
return 0;
}
Niby dzia?a, ale radio za??cza si? ca?y czas co 1 sekunde, a ja chce ?eby za??czy?o si? tylko raz, a drugi raz dopiero gdy gracz wejdzie strefe wy??czaj?c? radio, i dopiero znowu do tej, kt?r? wam poda?em wy?ej.
Wysłany: 2014-02-21, 13:45
xqz
otaku desu!
Wiek: 32 Na forum: 6406 dni Posty: 723
Nick w MP: xqz
Piwa : 5465
Kod: new skarpety[MAX_PLAYERS];
forward klubmuza();
public klubmuza()
{
for(new i=0, g=GetMaxPlayers(); i<g; i++)
{
if(!IsPlayerConnected(i))
continue;
if(IsPlayerInArea(i, 494.5629, 491.5821, -22.8813, -24.9576))
{
if(!skarpety[i])
{
PlayAudioStreamForPlayer(i, "http://polskastacja.pl/play/aac_clubhits.pls");
SendClientMessage(i, KOLOR_BORDOWY, "Witaj w klubie.");
skarpety[i]=1;
}
}
else
{
if(skarpety[i]) skarpety[i]=0;
}
}
return 0;
}
Wysłany: 2014-02-21, 14:12
PePPaPyT
Świat Życia
Wiek: 32 Na forum: 6375 dni Posty: 55
Nick w MP: Roger_Crotty
Piwa : 551
Zrobi?em to troche inaczej bo tak: Kod: new skarpety[MAX_PLAYERS];
forward klubmuza();
public klubmuza()
{
for(new i=0, g=GetMaxPlayers(); i<g; i++)
{
if(!IsPlayerConnected(i))
continue;
if(IsPlayerInArea(i, 494.5629, 491.5821, -22.8813, -24.9576))
{
if(!skarpety[i])
{
PlayAudioStreamForPlayer(i, "http://polskastacja.pl/play/aac_clubhits.pls");
SendClientMessage(i, KOLOR_BORDOWY, "Witaj w klubie.");
skarpety[i]=1;
}
}
}
return 0;
}
forward klubmuzawyl();
public klubmuzawyl()
{
for(new i=0, g=GetMaxPlayers(); i<g; i++)
{
if(!IsPlayerConnected(i))
continue;
if(IsPlayerInArea(i, -253.2796, -255.1497, 2605.5054, 2600.9260))
{
if(skarpety[i])
{
StopAudioStreamForPlayer(i);
skarpety[i]=0;
}
}
}
return 0;
}
Ale te twoje skarpety by?y kluczowe, dzieki.
Wysłany: 2014-02-21, 14:50
xqz
otaku desu!
Wiek: 32 Na forum: 6406 dni Posty: 723
Nick w MP: xqz
Piwa : 5465
Kod: forward klubmuza();
public klubmuza()
{
for(new i=0, g=GetMaxPlayers(); i<g; i++)
{
if(!IsPlayerConnected(i))
continue;
if(IsPlayerInArea(i, 494.5629, 491.5821, -22.8813, -24.9576))
{
if(!skarpety[i])
{
PlayAudioStreamForPlayer(i, "http://polskastacja.pl/play/aac_clubhits.pls");
SendClientMessage(i, KOLOR_BORDOWY, "Witaj w klubie.");
skarpety[i]=1;
}
}
else if(IsPlayerInArea(i, -253.2796, -255.1497, 2605.5054, 2600.9260))
{
if(skarpety[i])
{
StopAudioStreamForPlayer(i);
skarpety[i]=0;
}
}
}
return 0;
}
Tagi: strefa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: