Score textdraw help
#1

I mad a textdraw to show score of the 2 teams LV and LS , but the text draw only show when a player die : here is the script:

onplayerdeath:
Код:
public OnPlayerDeath(playerid,killerid,reason)
{

  if(gTeam[playerid]==TEAM_LS)
  {
  lvscore++;
  }else{
  lsscore++;
  }
  new tmpstr[50]; 
  format(tmpstr,sizeof(tmpstr),"LS: %d  LV: %d",lsscore,lvscore);
  TextDrawSetString(Textdraw2,tmpstr);
  


	if(lsscore == 10) {
  SendRconCommand("gmx");
  GameTextForAll("The Los Santos Team Has Won", 2500,5);
  }
  
  else if(lvscore == 10) {
  SendRconCommand("gmx");
  GameTextForAll("The Los Venturas Team Has Won", 2500,5);
 	}

  return 1;

}
ongamemodeinit:
Код:
public OnGameModeInit()
{
  Textdraw2 = TextDrawCreate(394.000000,1.000000," ");
	TextDrawShowForAll(Textdraw2);
	TextDrawAlignment(Textdraw2,0);
	TextDrawBackgroundColor(Textdraw2,0x0000ffcc);
	TextDrawFont(Textdraw2,3);
	TextDrawLetterSize(Textdraw2,0.399999,1.100000);
	TextDrawColor(Textdraw2,0xffffffff);
	TextDrawSetOutline(Textdraw2,1);
	TextDrawSetProportional(Textdraw2,1);
	TextDrawSetShadow(Textdraw2,1);
    return 1;
}
anyone know how to fix it?
Reply
#2

anyone know how to fix it?
Reply
#3

Its because you have it blank until its set on death..
Try this:
pawn Код:
Textdraw2 = TextDrawCreate(394.000000,1.000000,"LS: 0  LV: 0");
    TextDrawAlignment(Textdraw2,0);
    TextDrawBackgroundColor(Textdraw2,0x0000ffcc);
    TextDrawFont(Textdraw2,3);
    TextDrawLetterSize(Textdraw2,0.399999,1.100000);
    TextDrawColor(Textdraw2,0xffffffff);
    TextDrawSetOutline(Textdraw2,1);
    TextDrawSetProportional(Textdraw2,1);
    TextDrawSetShadow(Textdraw2,1);
    TextDrawShowForAll(Textdraw2);
Oh and by the way that's a nice looking sig..
Reply
#4

dude thank u very much , it worked , i really appreciate it !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)