In my opinion your code looks horrible and you made many mistakes and I'm not talking about indentation or about if it works fine or not, but the whole idea.
Why do you divide players into ts and cts? You could get the same effect by displaying only 2 items in menu (increase health when in ct, increase health when in t). You should store costs and health bonuses in some global arrays so you can use them to check everything in 2 lines of code instead of making very long switch with 10 cases. In other words: your menu handler could be like 10 times shorter and much easier to read.
When you are coding xp/points mod you should do it step by step and make sure it all works fine after each step. Before you code saving and loading from database, you should check if health adding works by doing this:
PHP Code:
client_authorized(id){
gPlayerPoints[id] = 100000
//disable loading from database
}
Then you go in game and make tests. After that you can play around with saving and loading points.
Recently I started to code RPG mod and this is how my handler for buy upgrades menu with multiple pages looks like:
PHP Code:
public hnd_menu_buy_upg(id,key){
static upg
if(key<8){
upg = g_enabled_list[g_p_menu_page[id]*8+key]
g_p_credits[id] -= g_upg_sp[upg] + g_upg_ip[upg]*g_p_upg[id][upg]
g_p_upg[id][upg]++
upgrade_change(id, upg, UPGC_AP)
menu_buy_upg(id, g_p_menu_page[id])
}else if(key==8){
menu_buy_upg(id, g_p_menu_page[id]+1)
}else{
menu_main(id)
}
return PLUGIN_HANDLED
}
well, I check if you can buy it in function that creates menu, but still it's just few lines in for loop...
__________________