little bit help (textdraw stats)
#1

Код:
new Text:TextDrawMoney;

public OnGamemodeInIt()
{
	TextDrawMoney = TextDrawCreate(414.000000, 400.000000, "~b~Money:~w~ ");
	TextDrawBackgroundColor(TextDrawMoney, 255);
	TextDrawFont(TextDrawMoney, 3);
	TextDrawLetterSize(TextDrawMoney, 0.70, 0.80);
	TextDrawSetOutline(TextDrawMoney, 1);
	TextDrawSetProportional(TextDrawMoney, 1);
	TextDrawUseBox(TextDrawMoney, 1);
             return 1;
}

public OnGameModeExit()
{
    TextDrawHideForAll(TextDrawMoney);
    TextDrawDestroy(TextDrawMoney);
    return 1;
}

public OnPlayerSpawn(playerid)
{
	TextDrawShowForPlayer(playerid, TextDrawMoney);
	return 1;
}

public OnPlayerUpdate(playerid)
{
   format(string, sizeof string, "~B~Money:~w~ %d", GetPlayerMoney(playerid));
   TextDrawSetString(TextDrawMoney, string);
   return 1;
}
its showing everyone stats to everyone like changing again n again like Money: 0 then suddenly show another player stats Money: 50000
Reply
#2

these kind of textdraws need to be player specific.

example:

new Text:Speed_TD[MAX_PLAYERS];

creating it under onplayerconnect:

Speed_TD[playerid] = TextDrawCreate(50.000000, 327.000000, "Loading...");
TextDrawBackgroundColor(Speed_TD[playerid], 65535);

...and so on...
Reply
#3

Use per-player textdraws instead.
Reply
#4

Код:
	TextDrawRank[playerid] = TextDrawCreate(414.000000, 413.000000, "~p~Rank:~w~");
when i type this not working

and konsantinos how to use that? my codes are same like that..
Reply
#5

No, they're not.

pawn Код:
new
    PlayerText:TextDrawMoney[MAX_PLAYERS] = {PlayerText: INVALID_TEXT_DRAW, ...};

public OnPlayerConnect(playerid)
{
    TextDrawMoney[playerid] = CreatePlayerTextDraw(playerid, 414.0, 400.0, "~b~Money:~w~ ");
    PlayerTextDrawBackgroundColor(playerid, TextDrawMoney[playerid], 255);
    PlayerTextDrawFont(playerid, TextDrawMoney[playerid], 3);
    PlayerTextDrawLetterSize(playerid, TextDrawMoney[playerid], 0.70, 0.80);
    PlayerTextDrawSetOutline(playerid, TextDrawMoney[playerid], 1);
    PlayerTextDrawSetProportional(playerid, TextDrawMoney[playerid], 1);
    PlayerTextDrawUseBox(playerid, TextDrawMoney[playerid], 1);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    PlayerTextDrawShow(playerid, TextDrawMoney[playerid]);
    return 1;
}

public OnPlayerUpdate(playerid)
{
   format(string, sizeof string, "~B~Money:~w~ %d", GetPlayerMoney(playerid));
   PlayerTextDrawSetString(playerid, TextDrawMoney[playerid], string);
   return 1;
}
Reply
#6

thanks konstantinos,!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)