// 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 |
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; }
It will only play for the player that typed that.
And the api doesn't work. |
Код:
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; } |