
|
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! |
public OnPlayerCommandPerformed(playerid, cmdtext[], 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;
}
|
Example:
PHP код:
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 |
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?
|
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.
|
Text[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Test TextDraw");