formatting audio
#1

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

Can you post the actual error?
Reply
#3

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

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

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

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)'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)