public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
if (!success) {
TextDrawShowForPlayer(playerid, Textdraw0);
SetTimerEx("InvalidKomanda", 3000, true, "");
}
return 1;
}
forward InvalidKomanda();
public InvalidKomanda()
{
TextDrawDestroy(Textdraw0);
}
Textdraw0 = TextDrawCreate(252.000000, 337.000000, "KOMANDA KOJU STE UKUCALI NEPOSTOJI");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 2);
TextDrawLetterSize(Textdraw0, 0.320000, 1.200000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
TextDrawUseBox(Textdraw0, 1);
TextDrawBoxColor(Textdraw0, 1679040075);
TextDrawTextSize(Textdraw0, 517.000000, 0.000000);
It doesn't show up because you're destroying it after it's shown the first time. Don't destroy it but hide it instead.
https://sampwiki.blast.hk/wiki/TextDrawHideForPlayer P.D: you'll have to pass playerid as an argument at SetTimerEx to know whose textdraw's going to be hidden. |
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
if (!success) {
TextDrawShowForPlayer(playerid, Textdraw0);
SetTimerEx("InvalidKomanda", 3000, false, "");
}
return 1;
}
forward InvalidKomanda();
public InvalidKomanda()
{
TextDrawHideForPlayer(MAX_PLAYERS, Textdraw0);
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if (!success) { TextDrawShowForPlayer(playerid, Textdraw0); SetTimerEx("InvalidKomanda", 3000, true, ""); TextDrawHideForPlayer(playerid, Textdraw0); } return 1; }
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if (!success) { TextDrawShowForPlayer(playerid, Textdraw0); SetTimerEx("InvalidKomanda", 3000, true, ""); TextDrawHideForPlayer(playerid, Textdraw0); } return 1; } |
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
if (!success) {
TextDrawShowForPlayer(playerid, Textdraw0);
SetTimerEx("InvalidKomanda", 5000, false, "i", playerid);
}
return 1;
}
forward InvalidKomanda(playerid);
public InvalidKomanda(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw0);
}
you can use this one :
PHP код:
|