/stats textdraw - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /stats textdraw (
/showthread.php?tid=331254)
/stats textdraw -
Beginnercoder - 04.04.2012
Hello, I am using ladmin.
How do I change the stats from showing in the mainchat and make them come up in a textdraw?
This is the code I want to come up in a textdraw.
pawn Код:
dcmd_stats(playerid,params[]) {
new string[128], pDeaths, player1, h, m, s;
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(IsPlayerConnected(player1)) {
TotalGameTime(player1, h, m, s);
if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
format(string, sizeof(string), "| %s's Stats: Kills: %d | Deaths: %d | Ratio: %0.2f | Money: $%d | Time: %d hrs %d mins %d secs |",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return SendClientMessage(playerid, green, string);
} else return SendClientMessage(playerid, red, "Player Not Connected!");
}
Re: /stats textdraw -
spd_sahil - 04.04.2012
after the format
add this code >>>
pawn Код:
TextDrawSetString(Textdrawidhere,string);
TextDrawShowForPlayer(player,textdrawidhere);
and then you might wanna remove the send client from return
and also you might wanna keep your textdraw arrayed
something like TextdrawStats[playerid]
so there is a unique textdraw for each player
and ALSO i hope your textdraw is created already