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;
}
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;
}
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? |
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 first problem, hide them when OnPlayerClickTextDraw gets called with clickedid 65535 (INVALID_TEXT_DRAW)
pawn Код:
![]() |