Audio Plugin Help
#1

I tried to compile my script but i get this error
Код:
G:\Games\Script\uhrp-\pawno\include\audio.inc(37) : error 001: expected token: "-identifier-", but found "-tagname-"
G:\Games\Script\uhrp-\pawno\include\audio.inc(37) : error 001: expected token: ";", but found "-label-"
G:\Games\Script\uhrp-\pawno\include\audio.inc(38) : error 001: expected token: "-identifier-", but found "-tagname-"
G:\Games\Script\uhrp-\pawno\include\audio.inc(38) : error 001: expected token: ";", but found "-label-"
G:\Games\Script\uhrp-\pawno\include\audio.inc(39) : error 001: expected token: "-identifier-", but found "-tagname-"
G:\Games\Script\uhrp-\pawno\include\audio.inc(39) : error 001: expected token: ";", but found "-label-"
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8092) : warning 202: number of arguments does not match definition
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8092) : warning 202: number of arguments does not match definition
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8092) : warning 202: number of arguments does not match definition
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8153) : warning 202: number of arguments does not match definition
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8153) : warning 202: number of arguments does not match definition
G:\Games\Script\uhrp-\gamemodes\UHRP.pwn(8153) : warning 202: number of arguments does not match definition
This is the line from audio.inc
Код:
native Audio_Play(playerid, audioid, bool:pause = false, bool:loop = false, bool:downmix = false);
native Audio_PlaySequence(playerid, sequenceid, bool:pause = false, bool:loop = false, bool:downmix = false);
native Audio_PlayStreamed(playerid, const url[], bool:pause = false, bool:loop = false, bool:downmix = false);
This is the line from my script
Код:
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);//Line 8092
			Audio_SetVolume(playerid, localhandle, volume);
			Audio_SetPosition(playerid, localhandle, seek);
		}
		else
		{
		    return 0;
		}
	}
	return 1;
}

SendAudioToRange(audioid, volume, seek, Float:x, Float:y, Float:z, Float:range)
{
	if(audiohandleglobal >= 99)
	{
	    audiohandleglobal = 0;
	}
	else
	{
	    audiohandleglobal++;
	}

	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
			if(Audio_IsClientConnected(i))
			{
                if(IsPlayerInRangeOfPoint(i,range,x,y,z))
                {
                    new localhandle = Audio_Play(i,audioid,false,false,false);// Line 8153
					Audio_Set3DPosition(i, localhandle, x, y, z, range);
					Audio_SetVolume(i, localhandle, volume);
					Audio_SetPosition(i, localhandle, seek);
     				audiohandle[i][audiohandleglobal] = localhandle;
                }
			}
	    }
	}
	return audiohandleglobal;
}
I've tried to update the plugins and includes but the error still the same.
Reply
#2

Hello!

When I try to compile your code it work.
=> https://sampforum.blast.hk/showthread.php?tid=82162

Try to replace this plugin and include and compile your script again.
Reply
#3

Still the same error...
Reply
#4

PHP код:
forward SendAudioToPlayer(playeridaudioidvolumeseek);
public 
SendAudioToPlayer(playeridaudioidvolumeseek)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
Audio_IsClientConnected(playerid))
        {
            new 
localhandle Audio_Play(playerid,audioid);//Line 8092
            
Audio_SetVolume(playeridlocalhandlevolume);
            
Audio_SetPosition(playeridlocalhandleseek);
        }
        else
        {
            return 
0;
        }
    }
    return 
1;
}
SendAudioToRange(audioidvolumeseekFloat:xFloat:yFloat:zFloat:range)
{
    if(
audiohandleglobal >= 99)
    {
        
audiohandleglobal 0;
    }
    else
    {
        
audiohandleglobal++;
    }
    foreach(
Playeri)
    {
        if(
IsPlayerConnected(i))
        {
            if(
Audio_IsClientConnected(i))
            {
                if(
IsPlayerInRangeOfPoint(i,range,x,y,z))
                {
                    new 
localhandle Audio_Play(i,audioid);// Line 8153
                    
Audio_Set3DPosition(ilocalhandlexyzrange);
                    
Audio_SetVolume(ilocalhandlevolume);
                    
Audio_SetPosition(ilocalhandleseek);
                     
audiohandle[i][audiohandleglobal] = localhandle;
                }
            }
        }
    }
    return 
audiohandleglobal;

And so?
Reply
#5

Nvm i was placed the #include <audio> under #include <sccanf2> and moved it above it and the problem is fixed lol, weird. Thanks by the way.
Reply
#6

Oh.. That's strange. OK, no problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)