Got tired of it. *help please*
#1

Someone can teach me how to build a textdraw command with time, I mean I'm trying to do when someone is typing wrong command, it will show at the screen textdraw " You have typed wrong command " for expiremental time, of 25 seconds? I tried alot of hours to get it, but didn't success, please can someone help me out?
I made the textdraw already, could someone import it into a timer?
Код:
Textdraw0 = CreatePlayerTextDraw(playerid,172.000000, 403.000000, "You cannot use this command");
PlayerTextDrawBackgroundColor(playerid,Textdraw0, 255);
PlayerTextDrawFont(playerid,Textdraw0, 2);
PlayerTextDrawLetterSize(playerid,Textdraw0, 0.390000, 1.600000);
PlayerTextDrawColor(playerid,Textdraw0, -1);
PlayerTextDrawSetOutline(playerid,Textdraw0, 1);
PlayerTextDrawSetProportional(playerid,Textdraw0, 1);
PlayerTextDrawSetSelectable(playerid,Textdraw0, 0);
Example: If I'll write /blabla and it doesn't include within the gamemode, it will show me the textdraw above for 25secs
Reply
#2

Top:

Код:
new PlayerText:CmdT[MAX_PLAYERS];
new CmdTimer[MAX_PLAYERS];
forward BadCmd(playerid);
Under public OnPlayerConnect(playerid)

Код:
CmdT[playerid] = CreatePlayerTextDraw(playerid,172.000000, 403.000000, "You cannot use this command");
PlayerTextDrawBackgroundColor(playerid,CmdT[playerid], 255);
PlayerTextDrawFont(playerid,CmdT[playerid], 2);
PlayerTextDrawLetterSize(playerid,CmdT[playerid], 0.390000, 1.600000);
PlayerTextDrawColor(playerid,CmdT[playerid], -1);
PlayerTextDrawSetOutline(playerid,CmdT[playerid], 1);
PlayerTextDrawSetProportional(playerid,CmdT[playerid], 1);
PlayerTextDrawSetSelectable(playerid,CmdT[playerid], 0);
Under public OnPlayerCommandPerformed(playerid, cmdtext[], success)

Код:
KillTimer(CmdTimer[playerid]);
PlayerTextDrawHide(playerid,CmdT[playerid]);
PlayerTextDrawShow(playerid,CmdT[playerid]);
CmdTimer[playerid]=SetTimerEx("BadCmd",25000,false,"i",playerid);
Anywhere:

Код:
public BadCmd(playerid)
{
PlayerTextDrawHide(playerid, CmdT[playerid]);
return 1;
}




- Not tested.
- It isn't the best way I guess.
Reply
#3

No need to create this texdraw for MAX_PLAYERS.
Just generate one single "global" texdraw and use ShowTexdrawForPlayer.
Replace the "return 0;" under OnPlayerCommand with the ShowTexdrawForPlayer and the timer my foreposter made.
Reply
#4

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

Код:
new PlayerText:CmdT[MAX_PLAYERS];
new CmdTimer[MAX_PLAYERS];
forward BadCmd(playerid);
Under public OnPlayerConnect(playerid)

Код:
CmdT[playerid] = CreatePlayerTextDraw(playerid,172.000000, 403.000000, "You cannot use this command");
PlayerTextDrawBackgroundColor(playerid,CmdT[playerid], 255);
PlayerTextDrawFont(playerid,CmdT[playerid], 2);
PlayerTextDrawLetterSize(playerid,CmdT[playerid], 0.390000, 1.600000);
PlayerTextDrawColor(playerid,CmdT[playerid], -1);
PlayerTextDrawSetOutline(playerid,CmdT[playerid], 1);
PlayerTextDrawSetProportional(playerid,CmdT[playerid], 1);
PlayerTextDrawSetSelectable(playerid,CmdT[playerid], 0);
Under public OnPlayerCommandPerformed(playerid, cmdtext[], success)

Код:
KillTimer(CmdTimer[playerid]);
PlayerTextDrawHide(playerid,CmdT[playerid]);
PlayerTextDrawShow(playerid,CmdT[playerid]);
CmdTimer[playerid]=SetTimerEx("BadCmd",25000,false,"i",playerid);
Anywhere:

Код:
public BadCmd(playerid)
{
PlayerTextDrawHide(playerid, CmdT[playerid]);
return 1;
}




- Not tested.
- It isn't the best way I guess.
Much apprcieate, works clearly thx. +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)