Advertisement
Guest User

Untitled

a guest
Jul 26th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.77 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. enum E_PLAYER_STATS // Percentages (between 0 - 100)
  4. {
  5.     Float:pStat_fat,
  6.     Float:pStat_stamina,
  7.     Float:pStat_muscle,
  8.     Float:pStat_respect,
  9.     Float:pStat_sexappeal
  10. };
  11.  
  12. new PlayerStats[MAX_PLAYERS][E_PLAYER_STATS];
  13.  
  14. ChangePlayerStat(playerid, E_PLAYER_STATS:stat, Float:amount)
  15. {
  16.     PlayerStats[playerid][stat] += amount;
  17.  
  18.     if(PlayerStats[playerid][stat] > 100) PlayerStats[playerid][stat] = 100; // First line in question
  19.     if(PlayerStats[playerid][stat] < 0) PlayerStats[playerid][stat] = 0; // Second line in question
  20.  
  21.     return 1;
  22. }
  23.  
  24. stock PrintPlayerRespect(playerid) printf("pStat_respect = %.2f", PlayerStats[playerid][pStat_respect]);
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     ChangePlayerStat(0, pStat_respect, 69);
  29.  
  30.     PrintPlayerRespect(0);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement