SA-MP Forums Archive
formatting audio - 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: formatting audio (/showthread.php?tid=538435)



formatting audio - Ghazal - 21.09.2014

Hi,

I am using
pawn Код:
CMD:test( playerid, params[ ] )
{
    format(mstring, sizeof(mstring), "translate.******.com/translate_tts?tl=en&q=Welcome back %s", PlayerName);
    PlayAudioStreamForPlayer(playerid, mstring);
    return 1;
}
however, its giving me an error in the formatting for the reason syntex error


Re: formatting audio - TakeiT - 21.09.2014

Can you post the actual error?


Re: formatting audio - Ghazal - 21.09.2014

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
Can you post the actual error?
Код:
syntax error in the expression, or invalid function call



Re: formatting audio - IceCube! - 21.09.2014

Where is mstring defined?
where is PlayerName defined?

If PlayerName is a function, it will need paramaters also, which is usually what causes this error.


Re: formatting audio - Ghazal - 22.09.2014

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Where is mstring defined?
where is PlayerName defined?

If PlayerName is a function, it will need paramaters also, which is usually what causes this error.
Sorry for the late reply .. I was in school

pawn Код:
stock PlayerName(playerid)
{
    new name[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, name, sizeof( name ) );
    return name;
}
pawn Код:
new mstring[2048];



Re: formatting audio - ranme15 - 22.09.2014

PHP код:
CMD:testplayeridparams[ ] )
{
    
format(mstringsizeof(mstring), "translate.******.com/translate_tts?tl=en&q=Welcome back %s"PlayerName(playerid));
    
PlayAudioStreamForPlayer(playeridmstring);
    return 
1;

You've forgot the '(playerid)'.