Textdraw
#1

How can I make a textdraw which will be showed by a command for example the command will be "/text" and when I type it to be shown a textdraw which will disappear in 10 seconds ? ( I don't need GameTextForPlayer)
Reply
#2

pawn Код:
CMD:text(playerid,params[])
{
    TextDrawShowForPlayer(playerid,TDid);
        SetTimerEx("HideMessage", timehere, 0, "i", playerid);

    return 1;
}

forward HideMessage(playerid);
public HideMessage(playerid)
{
    TextDrawHideForPlayer(playerid, TextdrawID);
}
Reply
#3

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
pawn Код:
CMD:text(playerid,params[])
{
    TextDrawShowForPlayer(playerid,TDid);
        SetTimerEx("HideMessage", timehere, 0, "i", playerid);

    return 1;
}

forward HideMessage(playerid);
public HideMessage(playerid)
{
    TextDrawHideForPlayer(playerid, TextdrawID);
}
Thank you a lot!
Reply
#4

3 Tips:

-Create a textdraw
-TextDrawShowForPlayer in command Ex:
pawn Код:
CMD:text(playerid, params[])
{
   TextDrawShowForPlayer(playerid, TextDraw1);
   return 1;
}
-SetTimerEx -EDITTED forgot that it will be better
Ex:
pawn Код:
CMD:text(playerid, params[])
{
   TextDrawShowForPlayer(playerid, TextDraw1);
   SetTimerEx("TextDrawHide", 10000,"d", playerid false); //10 Seconds
   return 1;
}
pawn Код:
forward TextDrawHide(playerid);
public TextDrawHide(playerid)
{
   TextDrawHideForPlayer(playerid, TextDraw1);
   return 1;
}
WARNING: You need to create the textdraw first

EDIT: Just a minute of difference between post of me and XtremeR
Reply
#5

You can create a timer.

Example
pawn Код:
CMD:text(playerid,params[]) //Creating the command.
{ //Opening brackets to execute functions
   TextdrawShowForPlayer(L-text); //Replace with your textdraw.
   SetTimerEx("RemoveText", 50000, false, "d", playerid); //Creating a timer.
   return 1; //Returning functions.
} //Closing command.

forward RemoveText(playerid) //Forwarding the remove text timer.

public RemoveText(playerid) //Adding functions to the timer to perform after the timer used in the test command.
{ //Opening brackets to execute function.
   TextdrawHideForPlayer(L-text); //Removing textdraw, replace with your textdraw code.
   return 1; //Returning functions.
} //Closing brackets
This might.

Edit:O.o I was too late.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)