[SOLVED]Textdraw on Connect and Disconnect
#1

OnPlayerDisconnect
pawn Код:
new newtext[41], name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  format(newtext, sizeof(newtext), "~r~%s ~w~has left the server", name);
  TextDrawSetString(TextdrawJoin1, newtext);
  TextDrawShowForAll(TextdrawJoin1);
  SetTimer("TextdrawDisconnectRemove", 9000, true);
OnPlayerConnect
pawn Код:
new newtext[41], name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  format(newtext, sizeof(newtext), "~g~%s ~w~has joined the server.", name);
  TextDrawSetString(TextdrawJoin, newtext);
  TextDrawShowForAll(TextdrawJoin);
  SetTimer("TextdrawJoinRemove", 9000, true);
Timers:

pawn Код:
forward TextdrawJoinRemove();
public TextdrawJoinRemove()
{
  TextDrawHideForAll(TextdrawJoin);
}
pawn Код:
forward TextdrawDisconnectRemove();
public TextdrawDisconnectRemove()
{
  TextDrawHideForAll(TextdrawJoin1);
}
OnGameModeInit
pawn Код:
TextdrawJoin = TextDrawCreate(35.000000,122.000000," ");
    TextdrawJoin1 = TextDrawCreate(35.000000,134.000000," ");
    TextDrawAlignment(TextdrawJoin,0);
    TextDrawAlignment(TextdrawJoin1,0);
    TextDrawBackgroundColor(TextdrawJoin,0x000000ff);
    TextDrawBackgroundColor(TextdrawJoin1,0x000000ff);
    TextDrawFont(TextdrawJoin,1);
    TextDrawLetterSize(TextdrawJoin,0.299999,1.200000);
    TextDrawFont(TextdrawJoin1,1);
    TextDrawLetterSize(TextdrawJoin1,0.299999,1.100000);
    TextDrawColor(TextdrawJoin,0xffffffff);
    TextDrawColor(TextdrawJoin1,0xffffffff);
    TextDrawSetOutline(TextdrawJoin,1);
    TextDrawSetOutline(TextdrawJoin1,1);
    TextDrawSetProportional(TextdrawJoin,1);
    TextDrawSetProportional(TextdrawJoin1,1);
    TextDrawSetShadow(TextdrawJoin,1);
    TextDrawSetShadow(TextdrawJoin1,1);
2 things.

1) The first time you connect, It loads and it disappears at the time I want it to. The scond time you join, it appears, but not for all players that are connected and it doesn't disappear at the time I want it.

2) This is not working for all players that are in the game right now.
Reply
#2

Help, This is important for the script.
Reply
#3

Quote:
Originally Posted by HydraX
Help, This is important for the script.
I'm sorry for the Bumps, But this is very urgent.
Reply
#4

Turn off the repeating, set true to false

pawn Код:
SetTimer("TextdrawJoinRemove", 9000, false);
on both timers.
Reply
#5

Quote:
Originally Posted by MadeMan
Turn off the repeating, set true to false

pawn Код:
SetTimer("TextdrawJoinRemove", 9000, false);
on both timers.
That means it will only set it once, and it won't disappear again..
Reply
#6

Did you try it?
Reply
#7

Obviously.. lol

EDIT: I know what I did wrong. It was a silly little typo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)