Score dosen't show?
#1

Код:
/*
	Basic Player Stats. Shows Score and Ping in a textdraw.
	Credits - iPLEOMAX
 		      [HK]Ryder[AN]
 		      SA:MP Team
*/
#include <a_samp>
new updatetimer[MAX_PLAYERS];
//Player Textdraws:
new PlayerText:Textdraw0[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
new PlayerText:Textdraw1[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
forward update(playerid);
public OnPlayerConnect(playerid)
{
	Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 498.398, 100.799, "Score - -=-");
	PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
	PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
	PlayerTextDrawFont(playerid, Textdraw0[playerid], 2);
	PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawShow(playerid, Textdraw0[playerid]);

	Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 497.600, 120.212, "Ping - -=- ms");
	PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
	PlayerTextDrawColor(playerid, Textdraw1[playerid], -1);
	PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
	PlayerTextDrawFont(playerid, Textdraw1[playerid], 2);
	PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
    PlayerTextDrawShow(playerid, Textdraw1[playerid]);

    updatetimer[playerid] = SetTimerEx("update", 1000, true, "d", playerid);
	return 1;
}
public update(playerid)
{
	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);
	return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
	PlayerTextDrawDestroy(playerid, Textdraw0[playerid]);
	Textdraw0[playerid] = PlayerText:INVALID_TEXT_DRAW;

	PlayerTextDrawDestroy(playerid, Textdraw1[playerid]);
	Textdraw1[playerid] = PlayerText:INVALID_TEXT_DRAW;

	KillTimer(updatetimer[playerid]);

	return 1;
}
But there is no textdraw on my screen. also if i set my score to 12331[whatever] but it dosen't show to in *Tab* Button dialog too..
Reply


Messages In This Thread
Score dosen't show? - by Tuntun - 15.11.2013, 10:25
Re: Score dosen't show? - by Tuntun - 15.11.2013, 10:48
Re: Score dosen't show? - by Sojo12 - 15.11.2013, 11:13
Re: Score dosen't show? - by Tuntun - 15.11.2013, 11:49
Re: Score dosen't show? - by dominik523 - 15.11.2013, 12:07
Re: Score dosen't show? - by Tuntun - 15.11.2013, 12:45
Re: Score dosen't show? - by dominik523 - 15.11.2013, 14:13

Forum Jump:


Users browsing this thread: 1 Guest(s)