17.09.2012, 06:48
Quote:
Код:
command(stats, playerid, params[]) { new string[128]; format(string, sizeof(string), "Player Stats: "); // depends what you want here, nick name? // Look at the message below, if you want a nick name, in the speech marks, set %u to find the nick name, and after the speech marks, set the enum and fields you want to get the data from. TextDrawShowForPlayer(playerid, STextdraw0); format(string, sizeof(string), "Score: %s", pInfo[playerid][pScore]); // looks for player's score... TextDrawShowForPlayer(playerid, STextdraw1); // this shows the textdraw using the string above format(string, sizeof(string), "Kills: %s", pInfo[playerid][pKills]); TextDrawShowForPlayer(playerid, STextdraw2); format(string, sizeof(string), "Deaths: %s", pInfo[playerid][pScore]); TextDrawShowForPlayer(playerid, STextdraw3); format(string, sizeof(string), "Robberies: %s", pInfo[playerid][pRobberies]); TextDrawShowForPlayer(playerid, STextdraw4); format(string, sizeof(string), "Arrests: %s", pInfo[playerid][pArrests]); TextDrawShowForPlayer(playerid, STextdraw5); return 1; } For this, you need to include ZCMD in your script: https://sampforum.blast.hk/showthread.php?tid=91354 |
This won't change the textdraws...
pawn Код:
CMD:stats(playerid, params[])
{
new string[50];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Player Stats: %s", name);
TextDrawShowForPlayer(playerid, STextdraw0);
TextDrawSetString(STextdraw0, string);
format(string, sizeof(string), "Score: %d", pInfo[playerid][pScore]);
TextDrawShowForPlayer(playerid, STextdraw1);
TextDrawSetString(STextdraw1, string);
format(string, sizeof(string), "Kills: %d", pInfo[playerid][pKills]);
TextDrawShowForPlayer(playerid, STextdraw2);
TextDrawSetString(STextdraw2, string);
format(string, sizeof(string), "Deaths: %d", pInfo[playerid][pDeaths]);
TextDrawShowForPlayer(playerid, STextdraw3);
TextDrawSetString(STextdraw3, string);
format(string, sizeof(string), "Robberies: %d", pInfo[playerid][pRobberies]);
TextDrawShowForPlayer(playerid, STextdraw4);
TextDrawSetString(STextdraw4, string);
format(string, sizeof(string), "Arrests: %d", pInfo[playerid][pArrests]);
TextDrawShowForPlayer(playerid, STextdraw5);
TextDrawSetString(STextdraw5, string);
return 1;
}