error 029: invalid expression, assumed zero Help
#1

Код:
forward SendAudioToPlayer(playerid, audioid, volume, seek);
public SendAudioToPlayer(playerid, audioid, volume, seek)
{
	if(IsPlayerConnected(playerid))
	{
		if(Audio_IsClientConnected(playerid))
		{
			new localhandle = Audio_Play(playerid,audioid,false,false,false);
			Audio_SetVolume(playerid, localhandle, volume);
			Audio_Seek(playerid, localhandle, seek);
		}
		else
		{
		    return 0;
		}
	}
	return 1;
}
And i get error 029 Please help
Reply
#2

Well, I have the latest audio plugin and this works perfectly for me:

pawn Код:
#include <a_samp>
#include <audio>

forward SendAudioToPlayer(playerid, audioid, volume, seek);
public SendAudioToPlayer(playerid, audioid, volume, seek)
{
    if(IsPlayerConnected(playerid))
    {
        if(Audio_IsClientConnected(playerid))
        {
            new localhandle = Audio_Play(playerid,audioid,false,false,false);
            Audio_SetVolume(playerid, localhandle, volume);
            Audio_SetPosition(playerid, localhandle, seek);//as far as I know Incognito has changed Audio_Seek to Audio_SetPosition
        }
        else
        {
            return 0;
        }
    }
    return 1;
}
Reply
#3

I added the new things from incognito and this what i get

Код:
 error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 029: invalid expression, assumed zero
warning 215: expression has no effect
Код:
forward SendAudioToPlayer(playerid, audioid, volume, seconds);
public SendAudioToPlayer(playerid, audioid, volume, seconds)
{
	if(IsPlayerConnected(playerid))
	{
		if(Audio_IsClientConnected(playerid))
		{
			new handleid = Audio_Play(playerid,audioid,false,false,false);
			Audio_SetVolume(playerid, handleid, volume);
			Audio_Setposition(playerid, handleid, seconds);
		}
		else
		{
		    return 0;
		}
	}
	return 1;
}
Picture: http://i.imgur.com/RY163kW.png

Second part

Код:
SendAudioToRange(audioid, volume, seconds, Float:x, Float:y, Float:z, Float:distance)
{
	if(audiohandleglobal >= 99)
	{
	    audiohandleglobal = 0;
	}
	else
	{
	    audiohandleglobal++;
	}

	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
			if(Audio_IsClientConnected(i))
			{
                if(IsPlayerInRangeOfPoint(i,distance,x,y,z))
                {
                    new handleid = Audio_Play(i,audioid,false,false,false);
					Audio_Set3DPosition(i, handleid, Float:x, Float:y, Float:z, Float:distance);
					Audio_SetVolume(i, handleid, volume);
					Audio_Setposition(i, handleid, seconds);
     				audiohandle[i][audiohandleglobal] = handleid;
                }
			}
	    }
	}
	return audiohandleglobal;
}
Picture: http://i.imgur.com/8B6kghF.png

third one

Код:
stock SendAudioURLToRange(url[], volume, seconds, Float:x, Float:y, Float:z, Float:distance)
{
    if(audiohandleglobal >= 99)
	{
	    audiohandleglobal = 0;
	}
	else
	{
	    audiohandleglobal++;
	}
	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
			if(Audio_IsClientConnected(i))
			{
                if(IsPlayerInRangeOfPoint(i,distance,x,y,z))
                {
                    new handleid = Audio_PlayStreamed(i,url,false,false,false);
     				Audio_Set3DPosition(i, handleid, Float:x, Float:y, Float:z, Float:distance);
					Audio_SetVolume(i, handleid, volume);
					Audio_Setposition(i, handleid, seconds);
     				audiohandle[i][audiohandleglobal] = handleid;
                }
			}
	    }
	}
	return audiohandleglobal;
}
Picture:http://i.imgur.com/nd0QPYx.png
Reply
#4

Help
Reply
#5

pawn Код:
Audio_SetVolume(playerid, handleid, volume);
            Audio_Setposition(playerid, handleid, seconds);
u have to say what is handleid. There isn't any argument to check handleid
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)