TextDraw Help - 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 Help (
/showthread.php?tid=376878)
TextDraw Help -
Deaglez - 12.09.2012
How do I show my score to the screen?
I want to show it with the text "Score: %"
How can I do that?
Re: TextDraw Help -
Deaglez - 12.09.2012
Anyone plz reply... I give +rep each person
Re: TextDraw Help -
Lordzy - 12.09.2012
pawn Код:
"Score:%i", GetPlayerScore(playerid));
Example:
pawn Код:
//Using zcmd.
COMMAND:myscore(playerid,params[])
{
SendClientMessage(playerid, 0xFF0000, "Score:%i, GetPlayerScore(playerid));
Re: TextDraw Help -
Deaglez - 12.09.2012
I mean textdraw, not that. But thanks.
Re: TextDraw Help -
Deaglez - 12.09.2012
How?
Re: TextDraw Help - Jarnu - 12.09.2012
pawn Код:
public OnPlayerUpdate(playerid) {
new string[256];
format(string, sizeof(string),"Scores:%d",GetPlayerScore(playerid));
TextDrawSetString(/*yourtextdraw*/,string);
return 1;
}
Re: TextDraw Help -
Camacorn - 12.09.2012
Quote:
Originally Posted by Jarnu
pawn Код:
public OnPlayerUpdate(playerid) { new string[256]; format(string, sizeof(string),"Scores:%d",GetPlayerScore(playerid)); TextDrawSetString(/*yourtextdraw*/,string); return 1; }
|
Just my input on this, the string doesn't need to be 256 cells, he is only displaying the players score. Also, I suggest not placing this under OnPlayerUpdate as I doubt the players score is going to get updated that many times a second, I suggest creating a timer that can be called every 5+ seconds to update the textdraw.
Re: TextDraw Help -
Deaglez - 12.09.2012
But. do I need to place it at OnGameModeInit?
Re: TextDraw Help -
Deaglez - 12.09.2012
What do i need to put here
Re: TextDraw Help -
[HK]Ryder[AN] - 12.09.2012
Your textdraw's Name