06.03.2012, 00:47
How can i transfer from text to text draw? I want to make the stats of a player show in a text draw instead of just normal text. I tried formating it like a clientmessage but i get unreachable code. (Im not expecting you to do it all for me just show me what i need to do)
This is the stats cmd
and the text draw im formatting it with
This is the stats cmd
pawn Код:
new id;
if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
new ReturnName[MAX_PLAYER_NAME];
GetPlayerName(id, ReturnName, sizeof(ReturnName));
new Float:ratio=floatdiv(PlayerInfo[id][Kills], PlayerInfo[lookupid][Deaths]);
format(szString, 256, "%d %d %.2f", PlayerInfo[id][Kills], PlayerInfo[id][Deaths], ratio);
format(szString, sizeof(szString), "* Player stats for %s (ID:%d)", ReturnName, id);
SendClientMessage(playerid, COLOR_YELLOW, szString);
format(szString, sizeof(szString), "* Kills > %d | Deaths > %d | (K/D): %.2f", PlayerInfo[id][Kills], PlayerInfo[id][Deaths], ratio);
SendClientMessage(playerid, COLOR_YELLOW, szString);
format(szString, sizeof(szString), "* Score > %d | Cookies > %d", GetPlayerScore(id), PlayerInfo[id][Cookies]);
SendClientMessage(playerid, COLOR_YELLOW, szString);
format(szString, sizeof(szString), "* Total Online Time: %i hours, %i minutes, and %i seconds", PlayerInfo[id][Hours], PlayerInfo[id][Minutes], PlayerInfo[id][Seconds]);
SendClientMessage(playerid, COLOR_YELLOW, szString);
return 1;
pawn Код:
stats1 = TextDrawCreate(7.000000, 136.000000, "* Player stats for %s (ID:%d)");
TextDrawAlignment(stats1, 0);
TextDrawLetterSize(stats1, 0.2, 0.7);
TextDrawColor(stats1, 0xffff00ff);
TextDrawSetOutline(stats1, 1);
TextDrawSetProportional(stats1, 1);
TextDrawSetShadow(stats1, 1);