17.09.2013, 16:41
guys my problem is that the score textdraw shows the score of player that has highest score.So i want every player to have his own textdraw Score.
heres my code
At top
On gamemod init
On player spawn
and finally i made a loop but it doesnt show the score of player but shows the highest score of a random guy
heres my code
At top
pawn Код:
new Text:Textdraw1;//Score TextDraw Hud
pawn Код:
Textdraw1 = TextDrawCreate(498.000000, 101.000000, "~g~score~w~:0000");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 3);
TextDrawLetterSize(Textdraw1, 0.500000, 0.799999);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
SetTimer("scoretimer", 1000, true);//Score textdraw Timer update
pawn Код:
new score[128];//Score textdraw string
TextDrawShowForPlayer(playerid,Textdraw1);
format(score,sizeof(score),"~g~Score~w~:%d",GetPlayerScore(playerid));
TextDrawSetString(Textdraw1,score);
pawn Код:
forward scoretimer(playerid);
public scoretimer()
{
for(new i = 1; i>0; i++)
{
if(IsPlayerConnected(i))
{
new score[128];
format(score, sizeof(score), "~g~Score~w~:%d",GetPlayerScore(i));
TextDrawSetString(Textdraw1, score);
}
}
return 1;
}