12.06.2014, 18:09
Okay, so I'll assume you are an experienced scripter who knows his way around, I'll just tell you the stages, generally.
You want to have an EXP variable for each player, preferably in an enum.
Each time you give a player EXP (such as completing a mission) you will want to see how much EXP he/she will have after you give him/her the EXP, if it's over 1000 (assuming you'll level up only at 1000 no matter what level you are at) you will want to get the difference between 1000 and his current EXP:
example: Player A has 600 EXP and you're giving him 500 EXP we don't 100 EXP to go to waste, so you will have to do 1000 - 600 = 400. You will then subtract 400 from the 500, you will level him up and SET (not add) his EXP to the remaining of the 500 which in this case is 100.
Also you'll probably want to save his data somewhere (a .ini file, a database) I guess that's it.
You want to have an EXP variable for each player, preferably in an enum.
Each time you give a player EXP (such as completing a mission) you will want to see how much EXP he/she will have after you give him/her the EXP, if it's over 1000 (assuming you'll level up only at 1000 no matter what level you are at) you will want to get the difference between 1000 and his current EXP:
example: Player A has 600 EXP and you're giving him 500 EXP we don't 100 EXP to go to waste, so you will have to do 1000 - 600 = 400. You will then subtract 400 from the 500, you will level him up and SET (not add) his EXP to the remaining of the 500 which in this case is 100.
Also you'll probably want to save his data somewhere (a .ini file, a database) I guess that's it.