SA-MP Forums Archive
[Question] Show Score with Textdraw - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Question] Show Score with Textdraw (/showthread.php?tid=72549)



[Question] Show Score with Textdraw - Marc_307 - 09.04.2009

Hi all,
I Wanted to show the core of tho Teams with Textdraw. Here is a part of the Script:
pawn Код:
#include <a_samp>

new DNBScore;
new WScore;
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;

forward UpdateScoreText();

public OnGameModeInit()
{
  SetTimer("UpdateScoreText",5000,1);
  DNBScore = 0;
    WScore = 0;
  Textdraw0 = TextDrawCreate(499.000000,103.000000,"Punktestand:");
    Textdraw1 = TextDrawCreate(499.000000,127.000000,"Arbeiter:");
    Textdraw3 = TextDrawCreate(499.000000,149.000000,"Da Nang Boys:");
    TextDrawTextSize(Textdraw0,607.000000,12.000000);
    TextDrawTextSize(Textdraw1,607.000000,0.000000);
    TextDrawTextSize(Textdraw3,607.000000,0.000000);
    TextDrawLetterSize(Textdraw0,0.499999,2.100000);
    TextDrawLetterSize(Textdraw1,0.399999,2.000000);
    TextDrawLetterSize(Textdraw2,0.399999,1.999999);
    TextDrawLetterSize(Textdraw3,0.299999,1.800000);
    TextDrawLetterSize(Textdraw4,0.399999,2.000000);
    TextDrawColor(Textdraw0,0xffffffff);
    TextDrawColor(Textdraw1,0x0000ffcc);
    TextDrawColor(Textdraw2,0x0000ffcc);
    TextDrawColor(Textdraw3,0xff0000cc);
    TextDrawColor(Textdraw4,0xff0000cc);
    return 1;
}

public UpdateScoreText()
{
    new score1[32];
    format(score1,sizeof(score1),"%d",WScore);
    TextDrawSetString(Textdraw2,score1);
    TextDrawShowForAll(Textdraw2);
    new score2[32];
    format(score2,sizeof(score2),"%d",DNBScore);
    TextDrawSetString(Textdraw4,score2);
    TextDrawShowForAll(Textdraw4);
    return 1;
}

public OnPlayerConnect(playerid)
{
        TextDrawShowForPlayer(playerid,Text:Textdraw0);
        TextDrawShowForPlayer(playerid,Text:Textdraw1);
        TextDrawShowForPlayer(playerid,Text:Textdraw3);
  return 1;
}
Almost everythink works well, but the Score, I want to show, is in the corner of the screen.
Can you help me?


Re: [Question] Show Score with Textdraw - Danand - 09.04.2009

Set the code in


Re: [Question] Show Score with Textdraw - ICECOLDKILLAK8 - 09.04.2009

Then whats the problem?
Quote:
Originally Posted by Danand
Set the code in
And dont spam


Re: [Question] Show Score with Textdraw - Rks25 - 09.04.2009

Change the locations.

Now you will think how can i do that?

Just simply make a new textdraw for test with Zamarohts Textdraw Editor.
Save it and use those locations.


Re: [Question] Show Score with Textdraw - Marc_307 - 09.04.2009

But when I add "Textdraw2 = TextDrawCreate(578.000000,128.000000,score1);" and "Textdraw4 = TextDrawCreate(578.000000,148.000000,score2);" under public OnGameModeInit(), pawn finds two errors:
error 017: undefined symbol "score1"
error 017: undefined symbol "score2"


Re: [Question] Show Score with Textdraw - SpiderPork - 09.04.2009

Use " in front of the text and behind.
So:

pawn Код:
Textdraw2 = TextDrawCreate(578.000000, 128.000000, "score1");
Textdraw4 = TextDrawCreate(578.000000, 148.000000, "score2");



Re: [Question] Show Score with Textdraw - Marc_307 - 09.04.2009

Thanks, now it works perfecly.