This is all what i'm trying todo:
For every kill player will receive xp. By by receiving, player join leagues. By joining leagues, player unlock achievements. By unlocking achievements, player receive golds.
My current database looks like this:
achievements:
id | name | description | reward_amount | to_unlock (int)
1 | League Master | Join %s League | 100 | 5
leagues:
id | name | xp
1 | Bronze | 250
2 | Silver | 500
3 | Gold | 1000
4 | Cristal | 2000
5 | Titan | 5000
player:
id | nick | golds
1 | Croxeye | 100
player_achievements:
player_id | achievement_id | unlocked
1 | 1 | 1
player_stats:
player_id | xp | league
1 | 250 | 1
So, I have 250 xp and I'm in Bronze League so I have unlocked 1 achievement (I have 5 to unlock becouse there's 5 leagues) and now I want to replace '%s' from 'description' and I try to do it like this:
PHP Code:
%s, (player[id][playerAchievements[i][unlocked]] == achievements[i][toUnlock] ? ("\d%s", achievements[i][description]) : ("\wCompleted."))
EDIT: I also need sopport for MySQL 8 server