neribojami pinigai
Posted: 2011 Jun 21 16:57
kaip padaryti, kad žaidėjai su t flagu galėtų turėti 20 tūkstančių pinigų?
Code: Select all
public read_gmsg_Money(id){ if(!is_user_connected(id)) return PLUGIN_HANDLED new current_total = read_data(1) if(current_total == 801) { current_total = 800 cs_set_user_money(id, current_total,0) money_total[id] = 0 } if(current_total >= MONEY_TIER && !money_total[id]) { money_total[id] = current_total send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) return PLUGIN_CONTINUE } if(money_total[id]) { money_total[id] += current_total - MONEY_TIER if(money_total[id] < MONEY_TIER) { cs_set_user_money(id,money_total[id],1) money_total[id] = 0 } else { send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE} public send_moneymsg(id, ammount, flash){ cs_set_user_money(id,MONEY_TIER,0) if(get_user_flags(id) & VIPB_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vipb) } else if(get_user_flags(id) & VIPS_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vips) } else if(get_user_flags(id) & VIPG_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vipg) } else if(!(get_user_flags(id) & VIP_FLAG)) { maxamount = 16000 } min_amount = 0 if(money_total[id] > maxamount) money_total[id] = maxamount if(money_total[id] < min_amount) money_total[id] = min_amount message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) write_long(money_total[id]-ammount) write_byte(0) message_end() message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) write_long(money_total[id]) write_byte(flash) message_end() return PLUGIN_CONTINUE}
Code: Select all
public read_gmsg_Money(id){ if(!is_user_connected(id)) return PLUGIN_HANDLED new current_total = read_data(1) if(current_total == 801) { current_total = 800 cs_set_user_money(id, current_total,0) money_total[id] = 0 } if(current_total >= MONEY_TIER && !money_total[id]) { money_total[id] = current_total send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) return PLUGIN_CONTINUE } if(money_total[id]) { money_total[id] += current_total - MONEY_TIER if(money_total[id] < MONEY_TIER) { cs_set_user_money(id,money_total[id],1) money_total[id] = 0 } else { send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE} public send_moneymsg(id, ammount, flash){ cs_set_user_money(id,MONEY_TIER,0) if(get_user_flags(id) & VIPB_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vipb) } else if(get_user_flags(id) & VIPS_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vips) } else if(get_user_flags(id) & VIPG_FLAG) { maxamount = get_pcvar_num(amx_maxmoney_vipg) } else if(!(get_user_flags(id) & VIP_FLAG)) { maxamount = 16000 } min_amount = 0 if(money_total[id] > maxamount) money_total[id] = maxamount if(money_total[id] < min_amount) money_total[id] = min_amount message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) write_long(money_total[id]-ammount) write_byte(0) message_end() message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) write_long(money_total[id]) write_byte(flash) message_end() return PLUGIN_CONTINUE}