Player Stats
#1

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

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;
and the text draw im formatting it with
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);
Reply
#2

https://sampwiki.blast.hk/wiki/TextDrawSetString
Reply
#3

thanks <3
Reply
#4

SnG, Do you Know how to Increase the Width/Hieght of the TextDrawBox?
Reply
#5

@NoZ

Код:
new Text:MyDefinedTextDraw[MY_MAX_PLAYERS_VARIABLE];
TextDrawTextSize(MyDefinedTextDraw, X.X, Y.Y);
@Thread Creator

Maybe if its Possible on your Side.

Please Do Somthing like the Following.

Код:
[SOLVED]Player Stats
Peace,
Ricey.
Reply
#6

Quote:
Originally Posted by NoZ
Посмотреть сообщение
SnG, Do you Know how to Increase the Width/Hieght of the TextDrawBox?
on this line: stats1 = TextDrawCreate(7.000000, 136.000000, "* Player stats for %s (ID:%d)");
i believe you would change the first number for width and second for height
Reply
#7

False ^

-----

TextDrawTextSize X.X Y.Y
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)