Textdraw only shows up one time but need to repeat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw only shows up one time but need to repeat (
/showthread.php?tid=491787)
Textdraw only shows up one time but need to repeat -
Immortal_LTU - 01.02.2014
Hello , i got a problem . So i made myself script when player enters wron command it will show the textdraw that command doesn't exist . So the problem is that it shows up only one time ex : i write /wrongcmd and it shows me that textdraw for 5 seconds but when i type another wrond cmd it doesn't show up .
All Code : (i'm using zcmd)
Код:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
Код:
Textdraw2 = TextDrawCreate(270.000091, 434.725921, "~w~ Jusu irasyta komanda ~r~nebuvo rasta !");
TextDrawLetterSize(Textdraw2, 0.196333, 1.376000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 2);
TextDrawSetProportional(Textdraw2, 1);
Код:
forward unknwmcmd(playerid);
public unknwmcmd(playerid)
{
TextDrawDestroy(Textdraw2);
return 1;
}
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessage(playerid, -1, "{3399FF}[Serveris] {FFFF00}Tokios Komandos Nera {3399FF}!");
TextDrawShowForPlayer(playerid, Textdraw2);
SetTimerEx("unknwmcmd", 5000, false, "i", playerid);
return 1;
}
Re: Textdraw only shows up one time but need to repeat -
BroZeus - 01.02.2014
this is right script --
Код:
forward unknwmcmd(playerid);
public unknwmcmd(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw2);
return 1;
}