toribio

toribio

Oct 5th, 2008
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. //topo:
  2. enum en_pstats
  3. {
  4.     pkills,
  5.     pmortes,
  6.     pkillhim
  7. }
  8. new pstats[MAX_PLAYERS][en_pstats];
  9.  
  10. //no comando "/kill":
  11. pstats[playerid][pkillhim]++;
  12.  
  13. //no OnPlayerDeath:
  14. pstats[playerid][pmortes]++;
  15. pstats[killerid][pkills]++;
  16.  
  17. //comando /stats:
  18. if(!strcmp(cmd, "/stats", true))
  19. {
  20.     new tmp[256];
  21.     tmp = strtok(cmdtext, idx);
  22.     if(!strlen(tmp))return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /stats [id]");
  23.     new plid = strval(tmp);
  24.     if(IsPlayerConnected(plid))
  25.     {
  26.         new string2[0x100], pname[MAX_PLAYER_NAME], Float:health2, Float:armour;
  27.         GetPlayerName(plid, pname, sizeof pname);
  28.         format(string2, sizeof string2, "Stats de %s:", pname);
  29.         SendClientMessage(playerid, 0xFF0000AA, string);
  30.         format(string2, sizeof string2, "Matou: [%d] Morreu: [%d] Suicidou: [%d] Dinheiro: [%d] Score: [%d]",
  31.         pstats[plid][pkills], pstats[plid][pmortes], pstats[plid][pkillhim], GetplayerMoney(plid), GetPlayerScore(plid));
  32.         SendClientMessage(playerid, 0xFFFFFFAA, string2);
  33.         GetPlayerHealth(plid, health2);
  34.         GetPlayerArmour(plid, armour);
  35.         format(string2, sizeof string2, "Vida: [%.1f] Colote: [%.1f]", health2, armour);
  36.         SendClientMessage(playerid, 0xFFFFFFAA, string2);
  37.     } else {
  38.         SendClientMessage(playerid, 0xFF0000AA, "Jogador nοΏ½o conectado!");
  39.     }
  40.     return 1;
  41. }
Add Comment
Please, Sign In to add comment