PDA

View Full Version : Get Song Time


srvr07
30/09/2017, 06:25 PM
I want hide textdraw when song finish. Is it possible?

Kaperstone
30/09/2017, 06:34 PM
SetTimer (http://wiki.sa-mp.com/wiki/SetTimer) and call TextDrawHideForPlayer (http://wiki.sa-mp.com/wiki/TextDrawHideForPlayer) function in the callback (when it finishes)

srvr07
30/09/2017, 06:36 PM
SetTimer (http://wiki.sa-mp.com/wiki/SetTimer) and call TextDrawHideForPlayer (http://wiki.sa-mp.com/wiki/TextDrawHideForPlayer) function in the callback (when it finishes)

I know these functions. I say is it possible SetTimer("hidetextdraws", SongTime, 0);
Getting song time and setting timer song time

AbyssMorgan
30/09/2017, 06:41 PM
GetSongTime:
http://abload.de/img/pngsaatclock_pngsaat-9ck17.png

Kaperstone
30/09/2017, 06:44 PM
I know these functions. I say is it possible SetTimer("hidetextdraws", SongTime, 0);
Getting song time and setting timer song time
There isn't a callback for that, nor a way to get information about the song unfortunately.

There are only play and stop.

You can do this with the audio plugin
http://forum.sa-mp.com/showthread.php?t=82162
but it will require all players to download the client.

jlalt
30/09/2017, 07:00 PM
You can make a php api which gets song length by its stream link and return it then get the data by samp http function and set timer by the returned interval.

Or maybe creating CPP plugin which gets song interval by its stream link.

[ keep in mind samp timers not accurate will need to use timer fixes. ]

srvr07
03/10/2017, 02:08 PM
There isn't a callback for that, nor a way to get information about the song unfortunately.

There are only play and stop.

You can do this with the audio plugin
http://forum.sa-mp.com/showthread.php?t=82162
but it will require all players to download the client.

I looked at this but I didn't understand how I get song time. If you know can you help me?