Wrong Command Textdraw Help
#1

so i basically want to get what wrong command the typer has typed and return that in a textdraw. I have no idea on how can i achieve that.

i want something like this



any help of help would be appreciated
Reply
#2

You must create a player textdraw, then use PlayerTextDrawSetString, and show it again.
Reply
#3

You can start off by telling us what command processor are you using.
Reply
#4

can you possibly show its usage? the wiki doesnt say much. I need a command like shown above. i have no idea how to set wrong command to a string
I'm using ZCMD!
Reply
#5

https://sampwiki.blast.hk/wiki/Textdraw
Reply
#6

Quote:
Originally Posted by Sulps
Посмотреть сообщение
can you possibly show its usage? the wiki doesnt say much. I need a command like shown above. i have no idea how to set wrong command to a string
I'm using ZCMD!
Example:

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)
    {
              new 
str[60];
              
format(str,sizeof(str),"%s is an invalid command",cmdtext);
              
PlayerTextDrawSetString(playerid,your_player_td_here[playerid],str);
              
PlayerTextDrawShow(playerid,your_player_td_here[playerid]);
    }
    return 
1;

You may use a timer to hide it.

If by any chance you didn't create your player textdraw yet. You might want to look into adri1's TDEditor: https://sampforum.blast.hk/showthread.php?tid=543002, but first make sure you learn what a textdraw is and how to use them: https://sampwiki.blast.hk/wiki/Textdraw
Reply
#7

Quote:
Originally Posted by Jelly23
Посмотреть сообщение
Example:

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)
    {
              new 
str[60];
              
format(str,sizeof(str),"%s is an invalid command",cmdtext);
              
PlayerTextDrawSetString(your_player_td_here[playerid],string);
              
PlayerTextDrawShow(playerid,your_player_td_here[playerid]);
    }
    return 
1;

You may use a timer to hide it.

If by any chance you didn't create your player textdraw yet. You might want to look into adri1's TDEditor: https://sampforum.blast.hk/showthread.php?tid=543002, but first make sure you learn what a textdraw is and how to use them: https://sampwiki.blast.hk/wiki/Textdraw
for example this is my player textdraw
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success)
	{
             
              Text[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Test TextDraw");
              new str[60];
              format(str,sizeof(str),"%s is an invalid command",cmdtext);
              PlayerTextDrawSetString(Text[playerid],string);
              PlayerTextDrawShow(playerid,Text[playerid]);
    }
    return 1;
}

would this work?
Reply
#8

Quote:
Originally Posted by Sulps
Посмотреть сообщение
for example this is my player textdraw
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success)
	{
             
              Text[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Test TextDraw");
              new str[60];
              format(str,sizeof(str),"%s is an invalid command",cmdtext);
              PlayerTextDrawSetString(Text[playerid],string);
              PlayerTextDrawShow(playerid,Text[playerid]);
    }
    return 1;
}

would this work?
Create your textdraw once on OnPlayerConnect, and yes it would work, but use a timer to hide it.
Reply
#9

Quote:
Originally Posted by Jelly23
Посмотреть сообщение
Create your textdraw once on OnPlayerConnect, and yes it would work, but use a timer to hide it.
So this code
Код:
Text[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Test TextDraw");
should be removed from here and pasted under onplayerconnect?

I will use a timer to hide it, first i figure how it is going to work
Reply
#10

I will give it a shot, Thanks alot man.
+rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)