Code:
#include <amxmodx>
#define XP_FOR_KILL 50
#define MAX_LEVEL 10
new playerxp[33];
new level[33];
public plugin_init() {
register_event("DeathMsg","event_deathmsg","a");
}
public event_deathmsg() {
new victim = read_data(2);
new attacker = get_user_attacker(victim);
if(!is_user_connected(attacker) || attacker == victim) {
return PLUGIN_CONTINUE;
}
if(level[attacker] < MAX_LEVEL) {
playerxp[attacker] += XP_FOR_KILL;
check_for_new_level(attacker);
}
return PLUGIN_CONTINUE;
}
// long function name, eh?
public check_for_new_level(id) {
new xpneeded = get_user_nextxp(id);
if(playerxp[id] > xpneeded) {
level[id]++;
// congratulatory stuff here
}
}
public get_user_nextxp(id) {
new currxp = 100;
for(new i=0;i<level[id];i++) {
currxp *= 2;
}
return currxp;
}
There's a start.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS