15.11.2013, 12:07
Where did you set player's score?
And also, create all of your textdraws inside OnGameModeInit
And on player connect just change textdraw's string, and start a timer:
EDIT: I've just found that player textdraws need to be put under on player connect. But still, you can create normal textdraws, and load score with them.
And also, create all of your textdraws inside OnGameModeInit
Код:
for(new i=0;i<MAX_PLAYERS;i++) { Textdraw0[i] = CreatePlayerTextDraw(i, 498.398, 100.799, "Score - -=-"); PlayerTextDrawAlignment(i, Textdraw0[i], 1); PlayerTextDrawColor(i, Textdraw0[i], -1); PlayerTextDrawSetOutline(i, Textdraw0[i], 1); PlayerTextDrawBackgroundColor(i, Textdraw0[i], 51); PlayerTextDrawFont(i, Textdraw0[i], 2); PlayerTextDrawSetProportional(i, Textdraw0[i], 1); PlayerTextDrawShow(i, Textdraw0[i]); Textdraw1[i] = CreatePlayerTextDraw(i, 497.600, 120.212, "Ping - -=- ms"); PlayerTextDrawAlignment(i, Textdraw1[i], 1); PlayerTextDrawColor(i, Textdraw1[i], -1); PlayerTextDrawSetOutline(i, Textdraw1[i], 1); PlayerTextDrawBackgroundColor(i, Textdraw1[i], 51); PlayerTextDrawFont(i, Textdraw1[i], 2); PlayerTextDrawSetProportional(i, Textdraw1[i], 1); PlayerTextDrawShow(i, Textdraw1[i]); }
Код:
new score[16], ping[16]; format(score, sizeof(score), "Score - %d", GetPlayerScore(playerid)); format(ping, sizeof(ping), "Ping - %d ms", GetPlayerPing(playerid)); PlayerTextDrawSetString(playerid, Textdraw0[playerid], score); PlayerTextDrawSetString(playerid, Textdraw1[playerid], ping); updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid);