Textdraw problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw problem (
/showthread.php?tid=545443)
Textdraw problem -
Supermaxultraswag - 08.11.2014
Код 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...
Re: Textdraw problem -
zT KiNgKoNg - 08.11.2014
Here you go.
pawn Код:
forward Xp(playerid);
public Xp(playerid)
{
new string[64];
format(string, sizeof(string), "%i/1000",GetPlayerScore(playerid));
TextDrawSetString(Textdraw1, string);
}
Re: Textdraw problem -
Supermaxultraswag - 08.11.2014
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
Re: Textdraw problem -
zT KiNgKoNg - 08.11.2014
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)
Re: Textdraw problem -
Supermaxultraswag - 08.11.2014
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 ;(
Re: Textdraw problem -
zT KiNgKoNg - 08.11.2014
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]
Re: Textdraw problem -
Supermaxultraswag - 08.11.2014
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];