[DUDA]їCуmo parar mъsica cuando el player presione de nuevo un comando?
#3

En esta callback agreguй lo siguiente:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(success)
    {
        return 1;
    }
        if (strcmp(cmd, "/ponermusica", true) == 0) 
        {
        ReproducirMusica[playerid] = 1;
        if(ReproducirMusica[playerid] > 0)
        {
        PlayAudioStreamForPlayer(playerid, "http://dc195.4shared.com/img/1630214316/f61b0a73/dlink__2Fdownload_2FFiINRnNc_3Ftsid_3D20130613-101904-44f63b80/preview.mp3");
        }
                return 1;
        }
        if (strcmp(cmd, "/pararmusica", true) == 0) 
        {
        ReproducirMusica[playerid] = 0;
        return 1;
        }
        return 0;
}
Y luego lo que hice fue poner en la callback public OnPlayerStateChange(playerid, newstate, oldstate), esto:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        if(ReproducirMusica[playerid] == 0)
	{
	    StopAudioStreamForPlayer(playerid);
	}
	return 1;
}
Y no me funciona, cual es el problemaaї?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)