Posts: 1,534
Threads: 179
Joined: Apr 2009
The first problem: When i type /radio and press the ESC key while in the selectable show, the textdraw doesn't dissapear. Is there anyway to fix it?
The second problem: When i put my mouse on a word, why all others under it becomes the same color?
Here a pic
Posts: 5,314
Threads: 12
Joined: Aug 2010
Reputation:
0
Each TextdDraw of style of music has different ID?
Posts: 1,534
Threads: 179
Joined: Apr 2009
Quote:
Originally Posted by Viniborn
Each TextdDraw of style of music has different ID?
|
yes
,
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW)
{
if(clickedid == techno)
{
PlayAudioStreamForPlayer(playerid, "http://listen.technobase.fm/dsl.pls");
}
else if(clickedid == hard)
{
PlayAudioStreamForPlayer(playerid, "http://listen.hardbase.fm/dsl.pls");
}
else if(clickedid == house)
{
PlayAudioStreamForPlayer(playerid, "http://listen.housetime.fm/dsl.pls");
}
else if(clickedid == dubstep)
{
PlayAudioStreamForPlayer(playerid, "http://dubstep.fm/listen.pls");
}
else if(clickedid == trance)
{
PlayAudioStreamForPlayer(playerid, "http://listen.trancebase.fm/dsl.pls");
}
else if(clickedid == stop)
{
StopAudioStreamForPlayer(playerid);
}
TextDrawHideForPlayer(playerid, radiobox0);
TextDrawHideForPlayer(playerid, radiobox1);
TextDrawHideForPlayer(playerid, radiobox2);
TextDrawHideForPlayer(playerid, radiobox3);
TextDrawHideForPlayer(playerid, radiobox4);
TextDrawHideForPlayer(playerid, techno);
TextDrawHideForPlayer(playerid, hard);
TextDrawHideForPlayer(playerid, house);
TextDrawHideForPlayer(playerid, dubstep);
TextDrawHideForPlayer(playerid, trance);
TextDrawHideForPlayer(playerid, stop);
CancelSelectTextDraw(playerid);
}
return 1;
}
Posts: 5,314
Threads: 12
Joined: Aug 2010
Reputation:
0
How are you using SelectTextDraw?
Posts: 1,534
Threads: 179
Joined: Apr 2009
Quote:
Originally Posted by Viniborn
How are you using SelectTextDraw?
|
in a command
pawn Код:
command(radio, playerid, params[])
{
#pragma unused params
TextDrawShowForPlayer(playerid, radiobox0);
TextDrawShowForPlayer(playerid, radiobox1);
TextDrawShowForPlayer(playerid, radiobox2);
TextDrawShowForPlayer(playerid, radiobox3);
TextDrawShowForPlayer(playerid, radiobox4);
TextDrawShowForPlayer(playerid, techno);
TextDrawShowForPlayer(playerid, hard);
TextDrawShowForPlayer(playerid, house);
TextDrawShowForPlayer(playerid, dubstep);
TextDrawShowForPlayer(playerid, trance);
TextDrawShowForPlayer(playerid, stop);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}
Posts: 5,314
Threads: 12
Joined: Aug 2010
Reputation:
0
To be honest I have not tested this.
At the moment I'm working, when I get home I'll do some tests to try help you.
Posts: 1,534
Threads: 179
Joined: Apr 2009
Quote:
Originally Posted by OPremium
For the first problem, hide them when OnPlayerClickTextDraw gets called with clickedid 65535 (INVALID_TEXT_DRAW)
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(_:clickedid != INVALID_TEXT_DRAW) { if(clickedid == techno) { PlayAudioStreamForPlayer(playerid, "http://listen.technobase.fm/dsl.pls"); } else if(clickedid == hard) { PlayAudioStreamForPlayer(playerid, "http://listen.hardbase.fm/dsl.pls"); } else if(clickedid == house) { PlayAudioStreamForPlayer(playerid, "http://listen.housetime.fm/dsl.pls"); } else if(clickedid == dubstep) { PlayAudioStreamForPlayer(playerid, "http://dubstep.fm/listen.pls"); } else if(clickedid == trance) { PlayAudioStreamForPlayer(playerid, "http://listen.trancebase.fm/dsl.pls"); } else if(clickedid == stop) { StopAudioStreamForPlayer(playerid); } TextDrawHideForPlayer(playerid, radiobox0); TextDrawHideForPlayer(playerid, radiobox1); TextDrawHideForPlayer(playerid, radiobox2); TextDrawHideForPlayer(playerid, radiobox3); TextDrawHideForPlayer(playerid, radiobox4); TextDrawHideForPlayer(playerid, techno); TextDrawHideForPlayer(playerid, hard); TextDrawHideForPlayer(playerid, house); TextDrawHideForPlayer(playerid, dubstep); TextDrawHideForPlayer(playerid, trance); TextDrawHideForPlayer(playerid, stop); CancelSelectTextDraw(playerid); } else { TextDrawHideForPlayer(playerid, radiobox0); TextDrawHideForPlayer(playerid, radiobox1); TextDrawHideForPlayer(playerid, radiobox2); TextDrawHideForPlayer(playerid, radiobox3); TextDrawHideForPlayer(playerid, radiobox4); TextDrawHideForPlayer(playerid, techno); TextDrawHideForPlayer(playerid, hard); TextDrawHideForPlayer(playerid, house); TextDrawHideForPlayer(playerid, dubstep); TextDrawHideForPlayer(playerid, trance); TextDrawHideForPlayer(playerid, stop); //Do not use CancelSelectTextDraw here!!! } return 1; }
For the second problem, change the sizes with TextDrawTextSize. Try different sizes until you find one that works perfectly
|
Problem solved, +rep!