Joining Text Draw
#1

pawn Код:
new Text:Textdraw0;
     Textdraw0 = TextDrawCreate(170.000000,410.000000,"%n_[ID:%i]_Has_Joined_the_server.");
    TextDrawUseBox(Textdraw0,0);
    TextDrawBoxColor(Textdraw0,0x000000ff);
    TextDrawTextSize(Textdraw0,-1.000000,146.000000);
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x0000ff33);
    TextDrawFont(Textdraw0,3);
    TextDrawLetterSize(Textdraw0,0.499999,0.800000);
    TextDrawColor(Textdraw0,0xffffffff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawShowForPlayer(playerid, Text:Textdraw0);

I have done this but how do i get the where the %n is to be a players name and %i to be the id to show when a person joins.. because i want to make Join/leave messages with textdraw..
Reply
#2

pawn Код:
new PlayerName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s [ID: %d] has joined the server.");
Textdraw0 = TextDrawCreate(170.000000, 410.000000, string);
Reply
#3

Quote:
Originally Posted by еddy
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s [ID: %d] has joined the server.");
Textdraw0 = TextDrawCreate(170.000000, 410.000000, string);
This shows my id but not my nickname
Reply
#4

Oops, I forgot something. Use this string:

pawn Код:
format(string, sizeof(string), "%s [ID: %d] has joined the server.", PlayerName, playerid);
Reply
#5

Quote:
Originally Posted by еddy
Oops, I forgot something. Use this string:

pawn Код:
format(string, sizeof(string), "%s [ID: %d] has joined the server.", PlayerName, playerid);
It works Thanks a million

EDIT:
What do i do to make the text Draw show for all ?
Heres what it's like now
pawn Код:
new Text:Textdraw0, Text:Textdraw1;
  new pName[MAX_PLAYER_NAME];
  new string[48];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s_(id:_%d)_has_joined_the_server.", pName, playerid);
  Textdraw0 = TextDrawCreate(170.000000, 410.000000, string);
    TextDrawTextSize(Textdraw0,-1.000000,146.000000);
  TextDrawUseBox(Textdraw0, 0);
  TextDrawBoxColor(Textdraw0, 0x000000AA);
  TextDrawFont(Textdraw0, 0);
  TextDrawSetShadow(Textdraw0,0);
  TextDrawSetOutline(Textdraw0,1);
  TextDrawBackgroundColor(Textdraw0,0x000000FF);
  TextDrawColor(Textdraw0,0xFFFFFFFF);
  TimeTextForPlayer(playerid,Textdraw0,Textdraw1,6000);
Reply
#6

Quote:
Originally Posted by еddy
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s [ID: %d] has joined the server.");
Textdraw0 = TextDrawCreate(170.000000, 410.000000, string);
TextDrawSetString is a lot more useful than your code.
Reply
#7

you'll probably either have to do a for (i < MAX_PLAYERS, i++) line or whatever, to where it basically loops the command over and over, for each Player ID. I'm not great of the "for" function but I believe thats how it works.
Reply
#8

showtextdrawforall maybe?
maybe im wrong cuz i didnt get really what u wanted^^
Reply
#9

Let's just leave this topic now?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)