Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- enum E_PLAYER_STATS // Percentages (between 0 - 100)
- {
- Float:pStat_fat,
- Float:pStat_stamina,
- Float:pStat_muscle,
- Float:pStat_respect,
- Float:pStat_sexappeal
- };
- new PlayerStats[MAX_PLAYERS][E_PLAYER_STATS];
- ChangePlayerStat(playerid, E_PLAYER_STATS:stat, Float:amount)
- {
- PlayerStats[playerid][stat] += amount;
- if(PlayerStats[playerid][stat] > 100) PlayerStats[playerid][stat] = 100; // First line in question
- if(PlayerStats[playerid][stat] < 0) PlayerStats[playerid][stat] = 0; // Second line in question
- return 1;
- }
- stock PrintPlayerRespect(playerid) printf("pStat_respect = %.2f", PlayerStats[playerid][pStat_respect]);
- public OnFilterScriptInit()
- {
- ChangePlayerStat(0, pStat_respect, 69);
- PrintPlayerRespect(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement