Music script
#1

I created this script:
Quote:

forward music();

public music()
{
new i;
for(i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 35, 100, 100, 100))
{
GameTextForPlayer(i, "~w~Music is now ~g~on", 5000, 5);
PlayerPlaySound(i, 1068, 100, 100, 100);


}else{

GameTextForPlayer(i, "~w~Music is now ~r~off", 5000, 5);
PlayerPlaySound(i, 1069, 100, 100, 100);
}

}
}return 1;
}

And it works with a timer:

Quote:

SetTimer("music",595,1);

But it doens't work. Well i mean that nothing work. It doesn't show the textdraw + the music don't work. Someone here knows why? And if you have any suggestion about a script that turn on a music when the player is in a certain part of the map and turn it off when he leave the area please post it here!
Reply
#2

Hmm, im not focusing at the code but you might have a pirated version of gta sa? thats what is disallowing it to work. Otherwise it must be wrong with the code.
Reply
#3

code looks fine to me where are you setting the timer?
Reply
#4

Are you in range of this point: if(IsPlayerInRangeOfPoint(i, 35, 100, 100, 100))?
Reply
#5

pawn Код:
public music()
{
    for(new a = 0, b = GetMaxPlayers(); a < b; a++)
    {
        if(IsPlayerInRangeOfPoint(a, 35.0, 100.0, 100.0, 100.0))
        {
            GameTextForPlayer(a, "~w~Music is now ~g~on", 5000, 5);
            PlayerPlaySound(a, 1068, 100, 100, 100);
        }
        else
        {
            GameTextForPlayer(a, "~w~Music is now ~r~off", 5000, 5);
            PlayerPlaySound(a, 1069, 100, 100, 100);
        }
    }
   
    return 1;
}
Try that, but I don't think the floatpoints in PlayerPlaySound work.
Reply
#6

pawn Код:
if(IsPlayerInRangeOfPoint(i, 35, 100, 100, 100))
I guess you don't even know 20% about what you're actually doing here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)