Scoreboard
#1

I know this has to (hopefully..at least) be an easy fix.

I have my scoreboard all set up so everything compiles perfect.
The only issue is that I can't get it to actually APPEAR on screen.

Something tells me it has to do with the string..thing >_>' I never
really understand those, I keep reading the wiki, but I couldn't figure
it out.

Anyways, here's the code of the string, n' stuffs.

Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  if(gTeam[playerid]==TEAM_SURVIVORS)
  {
    if(gTeam[playerid]==TEAM_SURVIVORS)GroveScore--; //otherwise punishment
    else BallasScore++;
  }else{
    if(gTeam[playerid]==TEAM_ZOMBIES)BallasScore--; //otherwise punishment
    else GroveScore++;
  }
  new tmpstr[50]; //Accommodate for string size
  format(tmpstr,sizeof(tmpstr),"Grove: %d  Ballas:%d",GroveScore,BallasScore);
  TextDrawSetString(Text:Textdraw2,tmpstr);
  return 1;
}
<_< The (Text:Textdraw2,tmpstr);
I feel like that might become a problem later, but lets focus on the whole "making it appear on the screen" deal.



Thank you. ^^
Reply
#2

You are only setting th string, you aren't actually showing the text-draw. Look at the wiki for functions regarding text-draws?
Reply
#3

Err..I have the TextDrawEditor [fs] for text draws
I saved them and they came out as:

Код:
//TextDraw developed using Zamaroht's in-game TextDraw system
 
//On top of script:
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
 
//In OnGameModeInit or any other place, we procced to create our textdraw:
Textdraw0 = TextDrawCreate(24.000000,315.000000,"SURVIVORS");
Textdraw1 = TextDrawCreate(24.000000,329.000000,"ZOMBIES");
Textdraw2 = TextDrawCreate(112.000000,315.000000,"SCORE");
Textdraw3 = TextDrawCreate(112.000000,329.000000,"SCORE");
TextDrawAlignment(Textdraw0,0);
TextDrawAlignment(Textdraw1,0);
TextDrawAlignment(Textdraw2,0);
TextDrawAlignment(Textdraw3,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawBackgroundColor(Textdraw1,0x000000ff);
TextDrawBackgroundColor(Textdraw2,0x000000ff);
TextDrawBackgroundColor(Textdraw3,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.499999,1.200000);
TextDrawFont(Textdraw1,3);
TextDrawLetterSize(Textdraw1,0.599999,1.099999);
TextDrawFont(Textdraw2,3);
TextDrawLetterSize(Textdraw2,0.599999,1.200000);
TextDrawFont(Textdraw3,3);
TextDrawLetterSize(Textdraw3,0.599999,1.100000);
TextDrawColor(Textdraw0,0x0000ffff);
TextDrawColor(Textdraw1,0xff0000ff);
TextDrawColor(Textdraw2,0xffffffff);
TextDrawColor(Textdraw3,0xffffffff);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetOutline(Textdraw1,1);
TextDrawSetOutline(Textdraw2,1);
TextDrawSetOutline(Textdraw3,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetProportional(Textdraw1,1);
TextDrawSetProportional(Textdraw2,1);
TextDrawSetProportional(Textdraw3,1);
TextDrawSetShadow(Textdraw0,1);
TextDrawSetShadow(Textdraw1,1);
TextDrawSetShadow(Textdraw2,1);
TextDrawSetShadow(Textdraw3,1);
 
//You can now use TextDrawShowForPlayer(-ForAll), TextDrawHideForPlayer(-ForAll) and
//TextDrawDestroy functions to show, hide, and destroy the textdraw.
xD And now that i'm reading it, it says I need to make it "TextDrawShowForPlayer"
^^ I feel so stupid.


And question -
If you look up I have 4 textdraws
Survivors
Zombies
Score
Score


Do i even need the "score" ones?
Reply
#4

Not sure what you're asking... If you want to have them show, then yeah. If not, you coould remove 'em.
Reply
#5

I got them to show. ^^

I got

Survivors [Score should appear here]
Zombies [Score should appear here]

but scores don't appear?
Might be because I can't kill anybody because
my server wont host for some reason.
Reply
#6

new ballascore = 0;?
Reply
#7

-----Mega Edit x-x------


fixed it myself, thanks for all that helped
Reply
#8

You set team for Textdraw2 which is not created, change to Textdraw0 or Textdraw1
also you check for team twice

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    if(gTeam[playerid]==TEAM_SURVIVORS) {
    GroveScore--; //otherwise punishment
    BallasScore++;
    }
    else{
    BallasScore--; //otherwise punishment
    GroveScore++;
    }
  }
with your version
else BallasScore++;
is useless cause it won't be ever executed, same as
else GroveScore++;
Reply
#9

^^ yeah I had to set it to textdraw 1 :P
I had a textdraw 2 but aparently it got wacked out
off the screen so nothing showed. ^^

Works great now though.

when the score is o - o it says "No Score"
then when a team gets a kill it goes to
Survivors: (score) Zombies: (score)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)