03.02.2010, 20:06
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:
ongamemodeinit:
anyone know how to fix it?
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;
}
Код:
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;
}

