AUDIO STREAM HELP???
#1

[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!
Reply
#2

The code seems alright. What errors are you getting?
Reply
#3

remove this
PHP код:
return 0;

Reply
#4

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]
Reply
#5

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
Reply
#6

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

Reply
#7

OMG THANKS U SO MUCH!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)