09.09.2017, 15:38
Hi guys! Just a bit confused on how i would do this..
I am trying to make a payday system where it will loop through all of the ranks.. and pay a different amount depending on the rank... However this is my first time looping through an enum and im not quite sure about how to do this.
Here is the code that I've thought of:
But with this, I am getting an error on the case line:
Please help me out, I really appreciate it, will give rep!
I am trying to make a payday system where it will loop through all of the ranks.. and pay a different amount depending on the rank... However this is my first time looping through an enum and im not quite sure about how to do this.
Here is the code that I've thought of:
Код:
for(new p = 0; fData:p < fData; p++) { switch(pData[i][FactionRank]) { case p: { FactionPayout += Faction_Data[factionid][fData:p]; format(str, sizeof(str), "Employement Pay: %i", Faction_Data[factionid][fData:p]); break; } default: break; } }
Код:
error 008: must be a constant expression; assumed zero