2021-04-30, 06:11 PM
(2021-04-28, 07:58 AM)Shadow Wrote: Good tutorial, you just forgot to mention that ternary operator supports multiple conditions.
For example:
PHP Code:SendClientMessage(playerid, -1, playerData[playerid][pAdmin] == 1 ? "Admin lvl 1" : playerData[playerid][pAdmin] == 2 ? "Admin lvl 2" : playerData[playerid][pAdmin] == 3 ? "Admin lvl 3" : "Admin lvl 4");
And btw, you don't need brackets, just own preference.
In your example the readability of the code is suffering. Nesting of conditions is not a good idea.