PlayAudioStream: Error 35 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayAudioStream: Error 35 (
/showthread.php?tid=353528)
PlayAudioStream: Error 35 -
wessoo - 23.06.2012
Uhh I mean wtf, can someone tell me what I did wrong?
Код:
C:\Users\Wesley\Desktop\New\gamemodes\SRP.pwn(24953) : error 035: argument type mismatch (argument 2)
C:\Users\Wesley\Desktop\New\gamemodes\SRP.pwn(24969) : error 035: argument type mismatch (argument 2)
C:\Users\Wesley\Desktop\New\gamemodes\SRP.pwn(31680) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
That's the errors, (don't mind the warning).
It shows 2x Error 35: Argument Type Mismatch.
A friend of mine told me it had to do with the numbers and stuff after the URL.
So I had this:
Код HTML:
PlayAudioStreamForPlayer(playerid, URL);
And he told me to change it to this:
Код HTML:
PlayAudioStreamForPlayer(playerid, URL, 0, 0, 0, 50.0, 0);
But the thing is, after I changed it I still got the same errors..
Here's my code:
PHP код:
command(play, playerid, params[])
{
new urlok;
if(!sscanf(params, "s", urlok))
{
PlayAudioStreamForPlayer(playerid, urlok, 0, 0, 0, 50.0, 0);
}
}
command(aplay, playerid, params[])
{
if(Player[playerid][AdminLevel] >=2)
{
new url;
if(!sscanf(params, "s", url))
{
for (new i=0; i < MAX_PLAYERS; i++)
{
new pName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s has just turned on a song!", pName);
PlayAudioStreamForPlayer(i, url, 0, 0, 0, 50.0, 0);
}
}
}
else if(Player[playerid][AdminLevel] <=1)
{
SendClientMessage(playerid, WHITE, "You are not an Administrator!");
}
else
{
SendClientMessage(playerid, WHITE, "SYNTAX: /play [url]");
}
return 1;
}
Re: PlayAudioStream: Error 35 -
[KHK]Khalid - 23.06.2012
pawn Код:
new url[32]; // changed it to url[32] (I don't think there's a url longer than 32 c anyway you can change that)
Also the PlayAudioStreamForPlayer can be used like that unless you need it in a certain position
pawn Код:
PlayAudioStreamForPlayer(playerid, url);
Re: PlayAudioStream: Error 35 -
wessoo - 23.06.2012
Thank you, itґs fixed now.