03.05.2013, 02:56
So I made a command so when it is used it shows me the textdraw, but when I use the command I want the textdraw to only show for 10sec... How would I do this?
CMD:loginscreen(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(sscanf(params, "s[16]", params)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /loninscreen [on/off]"); return 1; } if(!strcmp(params, "on", true)) { SendClientMessage(playerid, COLOR_WHITE, " You have toggled the loginscreen {33AA33}on{FFFFFF}."); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[0]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[1]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[2]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[3]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[4]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[5]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[6]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[7]); TextDrawShowForPlayer(playerid,MainMenuTxtdraw[8]); } else if(!strcmp(params, "off", true)) { SendClientMessage(playerid, COLOR_WHITE, " You have toggled Join Messages {FF9900}off{FFFFFF}."); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[0]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[1]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[2]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[3]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[4]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[5]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[6]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[7]); TextDrawHideForPlayer(playerid,MainMenuTxtdraw[8]); } return 1; }
forward HideMainMenuTxtDraw(playerid);
public HideMainMenuTxtDraw(playerid)
{
for(new i = 0; i < 9; i++) { TextDrawHideForPlayer(playerid,MainMenuTxtdraw[i]); }
}