Score 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Score textdraw help (
/showthread.php?tid=125431)
Score textdraw help -
hvampire - 03.02.2010
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?
Re: Score only show when player die -
hvampire - 03.02.2010
anyone know how to fix it?
Re: Score textdraw help -
s0nic - 03.02.2010
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..
Re: Score textdraw help -
hvampire - 03.02.2010
dude thank u very much , it worked , i really appreciate it !!!