Guest User

Statsi u Dialogu

a guest
Jul 23rd, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <a_samp>
  2. #define Dialogonclick 700
  3.  
  4. new c_score,c_money,Float:c_health,Float:c_armour,c_deaths,c_kills, c_skin;
  5. enum k_m{ Kills, Deaths,}
  6. new c_stat[MAX_PLAYERS][k_m];
  7. new PlayerName[MAX_PLAYER_NAME];
  8. new string[150];
  9. new msgbox[150];
  10. public OnFilterScriptInit()
  11. {
  12. print(" ----------------------------------- ");
  13. print(" -----------Stats u Dialogu-----------\n");
  14. print(" -------------7/23/2012-------------\n");
  15. print(" -------------Loaded--------------\n");
  16. print(" -------------------------------");
  17. return 1;
  18. }
  19.  
  20. public OnPlayerDeath(playerid, killerid, reason)
  21. {
  22. c_stat[playerid][Deaths]++;
  23. c_stat[killerid][Kills]++;
  24. return 1;
  25. }
  26.  
  27. public OnPlayerCommandText(playerid, cmdtext[])
  28. {
  29. if (strcmp("/stats", cmdtext, true, 10) == 0)
  30. {
  31. c_score=GetPlayerScore(playerid);
  32. c_skin=GetPlayerSkin(playerid);
  33. GetPlayerHealth(playerid,c_health);
  34. GetPlayerArmour(playerid,c_armour);
  35. c_money=GetPlayerMoney(playerid);
  36. c_deaths=c_stat[playerid][Deaths];
  37. c_kills=c_stat[playerid][Kills];
  38. GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
  39. format(PlayerName,sizeof PlayerName,"Ime: %s",PlayerName);
  40. msgbox="Level: %d\nNovac: %d\nHealth: %.1f\nPancir: %.1f\nSmrti: %d\nUbistava: %d\nSkin ID: %d";
  41. format(string,sizeof string,msgbox,c_score,c_money,c_health,c_armour,c_deaths,c_kills,c_skin);
  42. ShowPlayerDialog(playerid,Dialogonclick,0,PlayerName,string,"Ok","");
  43. return 1;
  44. }
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment