SA-MP Forums Archive
AUDIO STREAM HELP??? - 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: AUDIO STREAM HELP??? (/showthread.php?tid=597458)



AUDIO STREAM HELP??? - Mill - 31.12.2015

[pawno]
if (strcmp("/radiopos", cmdtext, true) == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
return 1;
}
return 0;
}
[/pawno]

Help please!

I have errors on: new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
And i have errors on: GetPlayerPos(playerid, X, Y, Z);

Help please!


Re: AUDIO STREAM HELP??? - Kitten - 31.12.2015

The code seems alright. What errors are you getting?


Re: AUDIO STREAM HELP??? - GeneralAref - 31.12.2015

remove this
PHP код:
return 0;




Re: AUDIO STREAM HELP??? - Mill - 31.12.2015

Quote:
Originally Posted by Kitten
Посмотреть сообщение
The code seems alright. What errors are you getting?
[PAWNO]
C:\Users\****\Desktop\FreeroamLatvianUD\gamemodes\ freeroam.pwn(1339) : error 001: expected token: "-identifier-", but found "-rational value-"
C:\Users\****\Desktop\FreeroamLatvianUD\gamemodes\ freeroam.pwn(1340) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664
[/PAWNO]

And the code im using:

[PAWNO]
if (strcmp("/radiopos", cmdtext, true) == 0)
{
new 3928.7813,2785.2285,1.0940, 15 = 5.0;
GetPlayerPos(playerid, 3928.7813,2785.2285,1.0940);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", 3928.7813,2785.2285,1.0940, 20, 1);
return 1;
}
[/PAWNO]


Re: AUDIO STREAM HELP??? - AndySedeyn - 31.12.2015

Why are you declaring a new variable for the distance? Seems redundant to me. Your syntax for the strcmp function is wrong.

PHP код:
if(strcmp(cmdtext"/radiopos"true) == 0)
// Or
if(!strcmp(cmdtext"/radiopos"true)) 
You're declaring numbers as variables. Not possible.
PHP код:
new Float:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);
PlayAudioStreamForPlayer(playerid"URL"xyz20.01); 
Read: https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables


Re: AUDIO STREAM HELP??? - Mill - 31.12.2015

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
Why are you declaring a new variable for the distance? Seems redundant to me. Your syntax for the strcmp function is wrong.

PHP код:
if(strcmp(cmdtext"/radiopos"true) == 0)
// Or
if(!strcmp(cmdtext"/radiopos"true)) 
You're declaring numbers as variables. Not possible.
PHP код:
new Float:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);
PlayAudioStreamForPlayer(playerid"URL"xyz20.01); 
Read: https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables

Im getting these errors

Quote:

C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336) : error 003: declaration of a local variable must appear in a compound block
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336) : warning 221: label name "Float" shadows tag name
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336) : error 017: undefined symbol "x"
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336) : warning 215: expression has no effect
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1337) : error 017: undefined symbol "x"
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(133 : error 017: undefined symbol "x"
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336) : warning 203: symbol is never used: "Float"
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336 -- 1342) : error 021: symbol already defined: "PlayerPlaySound"
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336 -- 1343) : error 010: invalid function or declaration
C:\Users\BOBIS\Desktop\FreeroamLatvianUD\gamemodes \freeroam.pwn(1336 -- 1343) : fatal error 107: too many error messages on one line




Re: AUDIO STREAM HELP??? - Mill - 31.12.2015

OMG THANKS U SO MUCH!