14.01.2011, 20:38
well first of all you dont need the two for loops you can just use one.,and the playerid param is being called using the for loop.... mabey thats your problem try this....
First script:
First script:
pawn Код:
forward Siren();
public Siren()
{
new Float: pPos[3][2];
GetPlayerPos(playerid, pPos[0][0], pPos[1][0], pPos[2][0]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(siren[playerid] == 0)
{
//GetPlayerPos(i, pPos[0][1], pPos[1][1], pPos[2][1]);
pPos[0][1] = -1935.770019;
pPos[1][1] = 228.789993;
pPos[2][1] = 34.156250;
soundID_siren[i] = Audio_Play(i, 1, false, true, false);
//Audio_SetVolume(i, soundID_siren[i], 0);
siren[playerid] = 1;
SendClientMessage(i,0xFFFFFFAA,"Siren started volumu 0");
}
else if(siren[playerid] == 1)
{
if(IsPlayerConnected(j) && !IsPlayerNPC(j))
{
Audio_Stop(j,soundID_siren[j]);
SendClientMessage(j,0xFFFFFFAA,"Siren stopped for you");
}
}
siren[playerid] = 0;
}
}
return 1;
}