PDA

View Full Version : Help with 1ERROR!


goviscrap
01/12/2012, 12:33 AM
I have only 1 error and i need help...
here is the ERROR and Warnings:

C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(138 61) : warning 202: number of arguments does not match definition
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(138 61) : error 036: empty statement
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(138 67) : warning 209: function "StreamScaryMusic" should return a value


1 Error.


And here is the code:
public StreamScaryMusic(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,-2097.8840,2714.8054,163.9876));
{
PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3,20, 1"); //Like this?
return true;
}
}
}

JaKe Elite
01/12/2012, 12:36 AM
if(IsPlayerInRangeOfPoint(playerid,-2097.8840,2714.8054,163.9876));


to


if(IsPlayerInRangeOfPoint(playerid, /*putyourradiohere*/, -2097.8840,2714.8054,163.9876))

example

if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))


and put return 1; before the brackets inside the Public.

Example


public StreamScaryMusic(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,-2097.8840,2714.8054,163.9876));
{
PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3,20, 1"); //Like this?
return true;
}
}
return 1;
}

goviscrap
01/12/2012, 12:42 AM
Thanks for answer!..

Ill did this:public StreamScaryMusic(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,2.0,-2097.8840,2714.8054,163.9876))
{
PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3,20, 1"); //Like this?
return true;
}
return 1;
}
}


And got this warning:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(138 67) : warning 209: function "StreamScaryMusic" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.


And I dont understand really..
if(IsPlayerInRangeOfPoint(playerid, /*putyourradiohere*/, -2097.8840,2714.8054,163.9876))
Shall I add the AudioStream URL where the comment line is? or just what i did 2.0?

JaKe Elite
01/12/2012, 12:49 AM
I meant to say "/*putyourradiushere*/" i just wake this morning so i can't post correctly right now.
And for the first warning do

this


public StreamScaryMusic(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, /*yourradiushere*/, -2097.8840,2714.8054,163.9876));
{
PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3,20, 1"); //Like this?
return true;
}
}
return 1;
}


"/*putyourrangehere*/" - The furthest distance the player can be to be in range.
Which means if the player is near in the range. The player can here the music.

goviscrap
01/12/2012, 01:07 AM
Thanks! =) now it Compiled with No errors or Warnings! :) BUT i had to remove one thing from you wrote to me";"
Because ive got a Error: Empty state.. :)
So now it works fine! :)
if(IsPlayerInRangeOfPoint(playerid, /*yourradiushere*/, -2097.8840,2714.8054,163.9876));..

goviscrap
01/12/2012, 01:11 AM
Tested the Code ingame but when i enters that Area Nothing happends?.. What can be the problem? :)

JaKe Elite
01/12/2012, 01:11 AM
remove the ";" in the IsPlayerInRangeOfPoint..

NumbSkull
01/12/2012, 01:14 AM
you took out the if(IsPlayerInRangeOfPoint(playerid, /*yourradiushere*/, -2097.8840,2714.8054,163.9876)) so it doesnt detect the area it just does it all over
try this
if(IsPlayerInRangeOfPoint(playerid, 30.0, -2097.8840,2714.8054,163.9876))
and make sure you are doing what ever calls public StreamScaryMusic(playerid)

goviscrap
01/12/2012, 01:49 AM
What more than forward do i have to add to make it call the Public? :)

JaKe Elite
01/12/2012, 02:08 AM
did you call the callback by setting a timer.
Or it's just a function??

goviscrap
01/12/2012, 03:03 PM
Nope I havent set a timer:P When I tries that it wont work eather :D

CmZxC
01/12/2012, 03:08 PM
The error is PlayAudioStreamForPlayer -.-, remove ",20,1" from the end, like this..


PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3");


and i dont think you can stream audio from a mediafire link.

goviscrap
01/12/2012, 03:18 PM
Okay ill try that! :D

goviscrap
01/12/2012, 05:06 PM
The error is PlayAudioStreamForPlayer -.-, remove ",20,1" from the end, like this..


PlayAudioStreamForPlayer(playerid,"http://205.196.120.224/1bdskxj5catg/ltnktunymuk/Free+Halloween+Music+mixed+by+MonsterPulse.mp3");


and i dont think you can stream audio from a mediafire link.

Yes I can stream from a Mediafire link :) Have tried that on my other Audio cmd :)

UPDATE: Nothing happends when I entering the area ive choosed :/