Jump to content
  • 0

Unde Pun Aceasta Comanda


Question

Posted

Problemă întâlnită (descriere): Vreau ca daca playerul este in zona asta sa dea "playaudio..." si cand iese din zona sa opreasca sunetul, unde trebuie sa pun liniile acestea?
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul:

 

if (IsPlayerInRangeOfPoint(playerid, 3.0,  2327.5669,2420.0872,10.8203)

{

 PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);

}

 

Imagini / Video (optional): -
Aţi încercat să rezolvaţi singur?: Da am adaugat la public onplayerupdate, stiam ca va pune sunetul incontinu dar am crezut ca poate merge:)

2 answers to this question

Recommended Posts

Posted (edited)

1. Pui la inceput: new PlayerInSound[MAX_PLAYERS];
2. La OnPlayerConnect pui PlayerInSound[playerid] = 0;
3. La OnPlayerUpdate:

[pawn]if(PlayerInSound[playerid] == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 3.0,2327.5669,2420.0872,10.8203))
{
PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
PlayerInSound[playerid] = 1;
}
}
else
{
if ( !IsPlayerInRangeOfPoint(playerid, 3.0,2327.5669,2420.0872,10.8203) )
{
PlayerPlaySound(playerid, 1098 , 0.0, 0.0, 0.0);
PlayerInSound[playerid] = 0;
}
}[/pawn]

Edited by Aslan
  • Upvote 1
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.