SA-MP Forums Archive
Error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error (/showthread.php?tid=156368)



Error - Libra - 22.06.2010

Can you guys help me, please? I know, it's a stupid error... But I don't know how to fix it

Код:
public OnGameModeInit(playerid)
{
	PlayerPlaySound(playerid,1063,0.0,0.0,0.0);
And I have got an error "error 025: function heading differs from prototype"

Can somebody help me?


Re: Error - Carlton - 22.06.2010

You can't make up your own parameters on callbacks. Removed the playerid from OnGameModeInit, and add the PlayerPlaySound someone else where there's a playerid parameter.




Re: Error - DJDhan - 22.06.2010

Put it under OnPlayerConnect. That way, it will play the sound when a new player connects for him.


Re: Error - Libra - 22.06.2010

Quote:
Originally Posted by DJDhan
Put it under OnPlayerConnect. That way, it will play the sound when a new player connects for him.
No, no! I have this:

Код:
PlayerPlaySound(playerid,1062,-3359.1,3008.2,1.7);
On "public SetupPlayerForClassSelection(playerid)"...

I want stop this music by using (on spawn):

Код:
PlayerPlaySound(playerid,1063,-3359.1,3008.2,1.7);



Re: Error - DJDhan - 22.06.2010

There is no function to stop a sound played by PlayerPlayerSound. It will get over once it's over. I suggest you use a shorter sound.


Re: Error - Hiddos - 22.06.2010

Quote:
Originally Posted by DJDhan
There is no function to stop a sound played by PlayerPlayerSound. It will get over once it's over. I suggest you use a shorter sound.
There is. Else San Andreas couldn't stopped some sounds either.

As on-topic:

There isn't a playerid variable for OnGameModeInit. OnGameModeInit simply loads and creates all the stuff you'd need later.


Re: Error - (SF)Noobanatior - 22.06.2010

use 1184 to turn the sound off


Re: Error - MadeMan - 22.06.2010

You need to use a loop and do it under OnGameModeExit because OnGameModeInit there are no players connected.