DJ System Issue -
Shockey HD - 28.01.2012
Howdy, Im using the PlayAudioStreamForPlayer function and im coming up with an issue.
Код:
CMD:dj(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new text,pName[MAX_PLAYER_NAME],string[128];
if(sscanf(params, "s[125]",text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /dj [Dropbox ID] [Filename]");
else
{
PlayAudioStreamForPlayer(playerid,"%s",text);
}
}
return 1;
}
Thats the code i just made
But the problem is, %s is not being replaced with the text i would like to use, as it is thinking that the audio file is %s.
Any suggestions?
Re: DJ System Issue -
coole210 - 28.01.2012
pawn Код:
CMD:dj(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new text,pName[MAX_PLAYER_NAME],string[128],url[50];
if(sscanf(params, "s[125]",text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /dj [Dropbox ID] [Filename]");
else
{
format(url,sizeof(url),"%s",text);
PlayAudioStreamForPlayer(playerid,url);
}
}
return 1;
}
Re: DJ System Issue -
Tanush123 - 28.01.2012
how about
pawn Код:
CMD:dj(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new text,pName[MAX_PLAYER_NAME],string[128];
if(sscanf(params, "s[125]",text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /dj [Dropbox ID] [Filename]");
format(string,sizeof(string),"%s",text);
PlayAudioStreamForPlayer(playerid,string);
}
return 1;
}
Re: DJ System Issue -
jamesbond007 - 28.01.2012
cool avatar OP
Re: DJ System Issue -
Shockey HD - 28.01.2012
Tanush, Your command gives me Unkown Command error. Coole, Yours crashes the server.
I was able to fix it, and here is what i have.
Код:
CMD:dj(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new text[60],pName[MAX_PLAYER_NAME],string[128];
new songid[40];
if(sscanf(params, "ds[125]",songid,text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /dj [Dropbox ID] [Filename]");
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"http://dl.dropbox.com/u/""%d""/""%s"".mp3",songid,text);
PlayAudioStreamForPlayer(i,string);
}
}
return 1;
}
It works and all, Expect if i have a song lets say Kayne West Power, The Spaces = %s but SAMP places it at # Any way i can fix that?
Re: DJ System Issue -
Tanush123 - 29.01.2012
oh shit sorry bro, i forgot to add [ ] for text
Re: DJ System Issue -
Shockey HD - 29.01.2012
No problem, And are you able to assist me with this issue,
http://dl.dropbox.com/u/54396459/You...ild%20Free.mp3
That is a song, But, SA-MP Replaces the % with #