Textdraw problem
#1

Код HTML:
public OnPlayerSpawn(playerid)
{
SetTimer("Xp", 3000, true);
	return 1;
}
Код HTML:
forward Xp(playerid);
public Xp(playerid)
{
new string[64];
format(string, sizeof(string), "%i/1000",GetPlayerScore(playerid));

TextDrawShowForPlayer(playerid, Textdraw1);
Textdraw1 = TextDrawCreate(559.199951, 149.333328, string);
TextDrawLetterSize(Textdraw1, 0.300000, 1.299999);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 2);
TextDrawSetProportional(Textdraw1, 1);
TextDrawShowForPlayer(playerid, Textdraw1);
}






As you see I dont know, how to make old textdraw(with old player scores) disappear and new textdraw (with new player scores) appear in same time...
Reply
#2

Here you go.

pawn Код:
forward Xp(playerid);
public Xp(playerid)
{
   new string[64];
   format(string, sizeof(string), "%i/1000",GetPlayerScore(playerid));
   TextDrawSetString(Textdraw1, string);
}
Reply
#3

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Here you go.

pawn Код:
forward Xp(playerid);
public Xp(playerid)
{
   new string[64];
   format(string, sizeof(string), "%i/1000",GetPlayerScore(playerid));
   TextDrawSetString(Textdraw1, string);
}
Wow, i dont even know about that function Thank you
Reply
#4

Not a problem, I would suggest looking at the wiki @ wiki.sa-mp.com - you'll get allot of information about textdraws and more features of sa-mp (default features)
Reply
#5

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Not a problem, I would suggest looking at the wiki @ wiki.sa-mp.com - you'll get allot of information about textdraws and more features of sa-mp (default features)
Well, i look and now i got a next question What is the difference between global textdraw and player textdraw? I mean where can i use global textdraw and where can i use player textdraw? Is this my script with scores can be used as global textdraw? I read that player td is more for one specific player, but i dont rly sure how to use it...

Srr for bad eng ;(
Reply
#6

Not a problem,
For your use i would recommend using Player textdraws, purely because you're getting that players score and showing them (It would be pointless showing one persons score for the rest of the server).

For a strange reason i've never actually used Player Textdraws, I've always used Global textdraws but used [MAX_PLAYERS] so its connected to that player, but i see it the same way for either Player TD's or Global TD's with [MAX_PLAYERS]
Reply
#7

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Not a problem,
For your use i would recommend using Player textdraws, purely because you're getting that players score and showing them (It would be pointless showing one persons score for the rest of the server).

For a strange reason i've never actually used Player Textdraws, I've always used Global textdraws but used [MAX_PLAYERS] so its connected to that player, but i see it the same way for either Player TD's or Global TD's with [MAX_PLAYERS]
The reason why i dont wanna use player td is that they had a limit (only 256!)... And how did you use [MAX_PLAYERS]? Smth like that? : new Text:Textdraw1[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)