TTS Script compiles perfectly ,but didn't work in-game :'(
#1

I want all the players in range of a player will hear what he said.
Quote:

// This is a comment
// uncomment the line below if you want to write a filterscript
//define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" fs");
print("--------------------------------------\n");
return 1;
}

public OnPlayerText(playerid, text[])
{
if IsPlayerInRangeOfPoint(playerid, 7.0, 1,1,1)
*then
new pText[144];
format(pText, sizeof (pText), "(%d) %s", playerid, text);
PlayAudioStreamForPlayer(playerid,"http://soundoftext.com/static/sounds/en/%s.mp3",1,1,1,7.0,1);
}
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" fs");
print("----------------------------------\n");
}

#endif

Reply
#2

It will only play for the player that typed that.

And the api doesn't work.
Reply
#3

Код:
public OnPlayerText(playerid, text[]) {
    new pText[144], Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
    format(pText, sizeof (pText), "http://soundoftext.com/static/sounds/en/%s.mp3", text);
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerInRangeOfPoint(i, 7.0, x, y, z) {
            PlayAudioStreamForPlayer(i, pText, x, y, z, 7.0, 1);
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Runn3R
Посмотреть сообщение
It will only play for the player that typed that.

And the api doesn't work.
I knew that! i need an API :/ .
Quote:
Originally Posted by d1git
Посмотреть сообщение
Код:
public OnPlayerText(playerid, text[]) {
    new pText[144], Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
    format(pText, sizeof (pText), "http://soundoftext.com/static/sounds/en/%s.mp3", text);
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerInRangeOfPoint(i, 7.0, x, y, z) {
            PlayAudioStreamForPlayer(i, pText, x, y, z, 7.0, 1);
        }
    }
    return 1;
}
Thanks , when i release it , i will mention your name and Runn3ER's name in the credits
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)