q7291172
|
分享:
▲
new PLUGIN_VERSION[] = "1.2" #define Resetcost 2000 #define Kill_Experience 120 #define Hos_Experience 50 #define Obj_Experience 80 #define MIN_PLAYERS 6 //Minimum players that are connected to get objective xp #define Max_Level 56 //How much the passive upgrades cost #define armorcost 1 #define hpcost 1 #define speedcost 1 #define gravitycost 1 #define stealthcost 4 #define multijumpcost 7 #define dmgcost 1 //How much the passive upgrades adds #define armorperbuy 7 #define hpperbuy 25 #define speedperbuy 4 //eg. 0.05 it will take off 5% of the users gravity #define gravityperbuy 0.08 //eg. (stealthperbuy = 60) times (stealthmaxlvl = 3) = 180 // the value must be lower than the defaultstealth #define defaultstealth 200 #define stealthperbuy 20 #define damage_PerLevel 500000.0 //How much the passive upgrades Max Level #define armormaxlvl 16 #define hpmaxlvl 23 #define speedmaxlvl 13 #define gravitymaxlvl 8 #define stealthmaxlvl 6 #define multijumpmaxlvl 2 #define MaxLevel_damage 8 #include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> #include <vault> #include <fun> #include <fakemeta> #include <hamsandwich> #define BOMB_TASK 1234 new LevelUpSound[] = { "events/task_complete.wav" } new DeniedSound[] = { "buttons/blip1.wav"} new UpgradedSound[] = { "items/tr_kevlar.wav" } new LEVELS[Max_Level] = { 300, 800, 1400, 2200, 3200, 4200, 5200, 6400, 7600, 8800, 10200, 11600, 13000, 14600, 15200, 17000, 18800, 20400, 23800, 26000, 30800, 34000, 40000, 45000, 50400, 58000, 64800, 70800, 78000, 85400, 90000, 97800, 105800, 116000, 125400, 135000, 144800, 154800, 165000, 175400, 186000, 198000, 201000, 215000, 225000, 238000, 245000, 260000, 276000, 290000, 310000, 330000, 350000, 380000, 410000, 1155000 }
new PlayerXp[33] new PlayerLevel[33] new PlayerPoints[33] new Armor[33] new Health[33] new Speed[33] new Gravity[33] new Stealth[33] new multijump[33] new jumpnum[33] new g_damageLevel[33] new bool:g_PlayerReseted[33] new bool:dojump[33] = false new bool:speed = true new hudmsg[512] new PLUGIN_NAME[] = "广东工业大学专用升级插件" new PLUGIN_AUTHOR[] = "Cheap_Suit, 后期设计:Eyeshield21" public plugin_init() { register_cvar("amx_upgrades", "1") register_menu("GDUT 主要升级菜单", 1023, "MainMenuCommand") register_menu("GDUT 技能菜单", 1023, "actionMenu") register_menu("Item Upgrade Menu", 1023, "EUAMenu") register_menu("Item 2 Upgrade Menu", 1023, "EUA2Menu") register_clcmd("say", "handlesay") register_clcmd("say_team", "handlesay") register_clcmd("upgrade", "MainUpgradesMenu") RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") register_event("ResetHUD", "Event_ResetHUD", "be") register_event("StatusValue","show_status","bd","1=2") register_event("DeathMsg", "Event_DeathMsg", "a") register_event("CurWeapon","update","be","1=1") register_event("Damage", "damage_msg", "b", "2!0", "3=0", "4!0") register_event("Damage", "Event_Damage1", "bd", "2>0") register_logevent("LogEvent_Objectives", 3, "1=triggered") server_cmd("sv_maxspeed 1500") set_task(0.1, "Main1UpgradesMenu", 12, _, _, "b") } public Event_ResetHUD(id) { if(!is_user_alive(id)) { return PLUGIN_CONTINUE } if(g_PlayerReseted[id]) { new iPoints = PlayerLevel[id] PlayerPoints[id] = iPoints Armor[id] = 0 Health[id] = 0 Speed[id] = 0 Gravity[id] = 0 Stealth[id] = 0 jumpnum[id] = 0 multijump[id] = 0 g_damageLevel[id] = 0 client_print(id, print_chat, "【广东工业大学提醒您】 您的技能点已经重置") g_PlayerReseted[id] = false SaveData(id) } if(get_cvar_num("amx_upgrades") == 1) { if(Armor[id] > 0) { new iap = (Armor[id] * armorperbuy) set_user_armor(id, 0 + iap) } if(Health[id] > 0) { new ihp = (Health[id] * hpperbuy) set_user_health(id, 250 + ihp) } speed = false set_task(get_cvar_float("mp_freezetime"), "allow_speed", 0) } return PLUGIN_CONTINUE } public Main1UpgradesMenu() { new Players[32], iNum get_players(Players, iNum) for(new i = 0; i < iNum; ++i) { new id = Players if(is_user_alive(id)) { new InfoMsg[255] format(InfoMsg, 254, "等级: %d/%d 经验值: %d/%d 技能点: %d ", PlayerLevel[id], Max_Level-1, PlayerXp[id], LEVELS[PlayerLevel[id]], PlayerPoints[id]) message_begin(MSG_ONE, get_user_msgid("StatusText"), {0, 0, 0}, id) write_byte(0) write_string(InfoMsg) message_end() } if(PlayerXp[id] >= LEVELS[Max_Level-1] || PlayerLevel[id] >= Max_Level-1) { PlayerLevel[id] = Max_Level-1 PlayerXp[id] = LEVELS[Max_Level-1] return PLUGIN_CONTINUE } if(PlayerXp[id] >= LEVELS[PlayerLevel[id]]) { PlayerLevel[id] += 1 PlayerPoints[id] += 1 showMenu(id) client_cmd(id, "spk %s", LevelUpSound) } } return PLUGIN_CONTINUE } public client_authorized(id) { { Armor[id] = 0 Health[id] = 0 Speed[id] = 0 Gravity[id] = 0 Stealth[id] = 0 jumpnum[id] = 0 multijump[id] = 0 g_damageLevel[id] = 0 LoadData(id) new iPoints = PlayerLevel[id] PlayerPoints[id] = iPoints if(PlayerXp[id] >= Resetcost){ PlayerXp[id] = PlayerXp[id] - Resetcost client_print(id, print_chat, "【广东工业大学提醒你】 你的技能点已经重置,并扣除了%d经验值", Resetcost) } if(PlayerXp[id] < Resetcost){ client_print(id, print_chat, "【广东工业大学提醒你】 你的技能点已经重置") } } return PLUGIN_CONTINUE }
public show_status(id) { if(get_cvar_num("amx_upgrades") != 1) return PLUGIN_CONTINUE new target = read_data(2) if(target != id && target != 0) { new name[32] get_user_name(target, name,31) new len = format(hudmsg, 511, "名字: %s^n提升技能:^n", name) len += format(hudmsg[len], 511-len, "等级: %d^n", PlayerLevel[target]) len += format(hudmsg[len], 511-len, "剩余技能点: %d^n", PlayerPoints[target]) len += format(hudmsg[len], 511-len, "护甲技能: %d/%d^n生命技能: %d/%d^n速度技能: %d/%d^n重力技能: %d/%d^n隐身技能: %d/%d^n多重跳跃: %d/%d^n伤害技能: %d/%d^n", Armor[target], armormaxlvl, Health[target], hpmaxlvl, Speed[target], speedmaxlvl, Gravity[target], gravitymaxlvl, Stealth[target], stealthmaxlvl, multijump[target], multijumpmaxlvl, g_damageLevel[target], MaxLevel_damage) len += format(hudmsg[len], 511-len, "^n暂无项目:^n") set_hudmessage(255, 255, 255, 0.6, -1.0, 0, 0.0, 6.0, 0.0, 0.0, 1) show_hudmessage(id, hudmsg) } return PLUGIN_CONTINUE } public allow_speed() { speed = true return PLUGIN_HANDLED } get_connectedplayers() { new cpl for(new i = 1; i <= get_maxplayers(); ++i) if(is_user_connected(i)) { cpl += 1 } return cpl } public LogEvent_Objectives() { if(get_connectedplayers() < MIN_PLAYERS) { return PLUGIN_CONTINUE } new sArg[64], sAction[64] read_logargv(0, sArg, 64) read_logargv(2, sAction, 64) new sName[1], iUserId, iExperienceGain parse_loguser(sArg, sName, 0, iUserId) new id = find_player("k", iUserId) if(equal(sAction,"Planted_The_Bomb") || equal(sAction, "Defused_The_Bomb") || equal(sAction, "Escaped_As_VIP")) { if(PlayerLevel[id] < 1) { iExperienceGain = Obj_Experience } else { iExperienceGain = Obj_Experience * PlayerLevel[id] } add_experience(id, iExperienceGain) client_print(id, print_chat, "你获得 %d 点经验", iExperienceGain) client_print(id, print_console, "*** 你获得 %d 点经验 ***", iExperienceGain) } else if(equal(sAction, "Rescued_A_Hostage")) { if(PlayerLevel[id] < 1) { iExperienceGain = Hos_Experience } else { iExperienceGain = Hos_Experience * PlayerLevel[id] } add_experience(id, iExperienceGain) client_print(id, print_chat, "你获得 %d 点经验", iExperienceGain) client_print(id, print_console, "*** 你获得 %d 点经验 ***", iExperienceGain) } return PLUGIN_CONTINUE } public Event_HostagesRescued() { if(get_connectedplayers() < MIN_PLAYERS) { return PLUGIN_CONTINUE } new iPlayers[32], iNum, i get_players(iPlayers, iNum, "ae", "CT") for(i = 0; i <= iNum; i++) { new id = iPlayers new iExperienceGain if(PlayerLevel[id] < 1) { iExperienceGain = Obj_Experience } else { iExperienceGain = Obj_Experience * PlayerLevel[id] } add_experience(id, iExperienceGain) client_print(id, print_chat, "你获得 %d 点经验", iExperienceGain) client_print(id, print_console, "*** 你获得 %d 点经验 ***", iExperienceGain) } return PLUGIN_CONTINUE } public Event_DeathMsg() { new attacker = read_data(1) new victim = read_data(2) if(!is_user_connected(attacker) || !is_user_connected(victim)) { return PLUGIN_CONTINUE } if(get_user_team(attacker) == get_user_team(victim)) { return PLUGIN_CONTINUE } if(attacker != victim) { new iExperienceGain if(PlayerLevel[attacker] < 1) { iExperienceGain = Kill_Experience } else { iExperienceGain = Kill_Experience * PlayerLevel[attacker] } add_experience(attacker, iExperienceGain) client_print(attacker, print_center, "你获得 %d 点经验", iExperienceGain) client_print(attacker, print_console, "***你获得 +%d 点经验 ***", iExperienceGain) } return PLUGIN_CONTINUE } public Event_Damage1(id) { if(!is_user_connected(id)) { return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
public damage_msg(id) { new attacker = get_user_attacker(id) if (is_user_connected(id) && is_user_connected(attacker)) { new damage = read_data(2) new iExperienceGain if(damage > 0) { iExperienceGain = damage } add_experience(attacker, iExperienceGain) } }
public client_disconnect(id) { Armor[id] = 0 Health[id] = 0 Speed[id] = 0 Gravity[id] = 0 Stealth[id] = 0 jumpnum[id] = 0 multijump[id] = 0 g_damageLevel[id] = 0 SaveData(id) return PLUGIN_CONTINUE } public handlesay(id) { new arg[64], arg1[32], arg2[32] read_args(arg,63) remove_quotes(arg) strtok(arg,arg1,255,arg2,255,' ',1) trim(arg2) if(arg1[0] == '/') { if(equali(arg1, "/ummenu") == 1 || equali(arg1, "/upgrades") == 1 || equali(arg1, "/upgrade") == 1) { MainUpgradesMenu(id) return PLUGIN_CONTINUE } } return PLUGIN_CONTINUE } public MainUpgradesMenu(id) { if(get_cvar_num("amx_upgrades") == 1) { new keys new szMenuBody[255] new len = format(szMenuBody, 511, "\rGDUT 主要升级菜单:^n") len += format(szMenuBody[len], 511-len, "^n\y1. 技能菜单") len += format(szMenuBody[len], 511-len, "^n^n^n\y7. 重置技能(花费 %d 经验值)", Resetcost) len += format(szMenuBody[len], 511-len, "^n\y8. 保存经验") len += format(szMenuBody[len], 511-len, "^n\y9. 升级版本信息") len += format(szMenuBody[len], 511-len, "^n^n\w0. 取消") keys = (1<<0|1<<6|1<<7|1<<8|1<<9) show_menu(id, keys, szMenuBody, -1) } else client_print(id,print_chat,"[AMXX] Credit Mod is currently disabled") return PLUGIN_HANDLED } public MainMenuCommand(id, key) { switch(key) { case 0: showMenu(id) case 6: { if(PlayerXp[id] < Resetcost){ client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的经验值重置技能") } if(PlayerXp[id] >= Resetcost){ PlayerXp[id] = PlayerXp[id] - Resetcost g_PlayerReseted[id] = true client_print(id, print_chat, "【广东工业大学提醒你】 你的技能点将在下回合重置") } } case 7: { SaveData(id) client_print(id, print_chat, "【广东工业大学提醒你】 你的经验值已经保存") } case 8: client_print(id, print_chat, "%s by %s Version: %s", PLUGIN_NAME, PLUGIN_AUTHOR, PLUGIN_VERSION) } return PLUGIN_HANDLED } public EU2Menu(id) { new keys new szMenuBody[512] new len = format(szMenuBody, 511, "\y暂无项目:^n") len += format(szMenuBody[len], 511-len, "^n^n\w9. 返回") len += format(szMenuBody[len], 511-len, "^n\w0. 取消") keys = (1<<8|1<<9) show_menu(id, keys, szMenuBody, -1) } public EUA2Menu(id, key) { switch(key) { case 8: EUMenu(id) } return PLUGIN_HANDLED } public EUMenu(id) { if(get_cvar_num("amx_upgrades") == 1) { new keys new szMenuBody[512] new len = format(szMenuBody, 511, "\y暂无项目:^n") len += format(szMenuBody[len], 511-len, "^n^n\w8. 下一页") len += format(szMenuBody[len], 511-len, "^n\w9. 返回") len += format(szMenuBody[len], 511-len, "^n\w0. 取消") keys = (1<<7|1<<8|1<<9) show_menu(id, keys, szMenuBody, -1) } } public EUAMenu(id, key) { switch(key) { case 7: EU2Menu(id) case 8: MainUpgradesMenu(id) } return PLUGIN_HANDLED } public showMenu(id) { if(get_cvar_num("amx_upgrades") == 1) { new keys new szMenuBody[512] new len = format(szMenuBody, 511, "\rGDUT 技能菜单:^n") if(PlayerPoints[id] >= armorcost){ len += format(szMenuBody[len], 511-len, "^n\y1. 提升护甲 (%d/%d 费用: %d 技能点)", Armor[id], armormaxlvl, armorcost) } if(PlayerPoints[id] < armorcost){ len += format(szMenuBody[len], 511-len, "^n\r1. 提升护甲 (%d/%d 费用: %d 技能点)", Armor[id], armormaxlvl, armorcost) } if(PlayerPoints[id] >= hpcost){ len += format(szMenuBody[len], 511-len, "^n\y2. 提升生命 (%d/%d 费用: %d 技能点)", Health[id], hpmaxlvl, hpcost) } if(PlayerPoints[id] < hpcost){ len += format(szMenuBody[len], 511-len, "^n\r2. 提升生命 (%d/%d 费用: %d 技能点)", Health[id], hpmaxlvl, hpcost) } if(PlayerPoints[id] >= speedcost){ len += format(szMenuBody[len], 511-len, "^n\y3. 提升速度 (%d/%d 费用: %d 技能点)", Speed[id], speedmaxlvl, speedcost) } if(PlayerPoints[id] < speedcost){ len += format(szMenuBody[len], 511-len, "^n\r3. 提升速度 (%d/%d 费用: %d 技能点)", Speed[id], speedmaxlvl, speedcost) } if(PlayerPoints[id] >= gravitycost){ len += format(szMenuBody[len], 511-len, "^n\y4. 提升重力 (%d/%d 费用: %d 技能点)", Gravity[id], gravitymaxlvl, gravitycost) } if(PlayerPoints[id] < gravitycost){ len += format(szMenuBody[len], 511-len, "^n\r4. 提升重力 (%d/%d 费用: %d 技能点)", Gravity[id], gravitymaxlvl, gravitycost) } if(PlayerPoints[id] >= stealthcost){ len += format(szMenuBody[len], 511-len, "^n\y5. 提升隐身 (%d/%d 费用: %d 技能点)", Stealth[id], stealthmaxlvl, stealthcost) } if(PlayerPoints[id] < stealthcost){ len += format(szMenuBody[len], 511-len, "^n\r5. 提升隐身 (%d/%d 费用: %d 技能点)", Stealth[id], stealthmaxlvl, stealthcost) } if(PlayerPoints[id] >= multijumpcost){ len += format(szMenuBody[len], 511-len, "^n\y6. 多重跳跃 (%d/%d 费用: %d 技能点)", multijump[id], multijumpmaxlvl, multijumpcost) } if(PlayerPoints[id] < multijumpcost){ len += format(szMenuBody[len], 511-len, "^n\r6. 多重跳跃 (%d/%d 费用: %d 技能点)", multijump[id], multijumpmaxlvl, multijumpcost) } if(PlayerPoints[id] >= dmgcost){ len += format(szMenuBody[len], 511-len, "^n\w7. 提升伤害(暂无效果,待完善) (%d/%d 费用: %d 技能点)", g_damageLevel[id], MaxLevel_damage, dmgcost) } if(PlayerPoints[id] < dmgcost){ len += format(szMenuBody[len], 511-len, "^n\r7. 提升伤害(暂无效果,待完善) (%d/%d 费用: %d 技能点)", g_damageLevel[id], MaxLevel_damage, dmgcost) } len += format(szMenuBody[len], 511-len, "^n^n\w9. 返回") len += format(szMenuBody[len], 511-len, "^n\w0. 取消") keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<8|1<<9) show_menu(id, keys, szMenuBody, -1) } return PLUGIN_CONTINUE } public actionMenu(id, key, value) { switch(key) { case 0: { if(PlayerPoints[id] < armorcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(Armor[id] == armormaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的护甲技能已升至最高级") if(PlayerPoints[id] >= armorcost && Armor[id] < armormaxlvl) { Armor[id]++ UserArmor(id, armorperbuy) upgradelevelup(id) decpoint(id,armorcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你增加了 %d 护甲", armorperbuy) } } case 1: { if(PlayerPoints[id] < hpcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(Health[id] == hpmaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的生命技能已升至最高级") if(PlayerPoints[id] >= hpcost && Health[id] < hpmaxlvl) { Health[id]++ UserHealth(id, hpperbuy) upgradelevelup(id) decpoint(id,hpcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你增加了 %d 生命", hpperbuy) } } case 2: { if(PlayerPoints[id] < speedcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(Speed[id] == speedmaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的速度技能已升至最高级") if(PlayerPoints[id] >= speedcost && Speed[id] < speedmaxlvl) { Speed[id]++ UserSpeed(id) upgradelevelup(id) decpoint(id,speedcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 增加了 %d 点速度", speedperbuy) } } case 3: { if(PlayerPoints[id] < gravitycost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(Gravity[id] == gravitymaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的重力技能已升至最高级") if(PlayerPoints[id] >= gravitycost && Gravity[id] < gravitymaxlvl) { Gravity[id]++ UserGravity(id) upgradelevelup(id) decpoint(id,gravitycost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你已减轻了重力") } } case 4: { if(PlayerPoints[id] < stealthcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(Stealth[id] == stealthmaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的隐身技能已升至最高级") if(PlayerPoints[id] >= stealthcost && Stealth[id] < stealthmaxlvl) { Stealth[id]++ UserStealth(id) upgradelevelup(id) decpoint(id,stealthcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你增加了透明度") } } case 5: { if(PlayerPoints[id] < multijumpcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(multijump[id] == multijumpmaxlvl) client_print(id, print_chat, "【广东工业大学提醒你】 你的多重跳跃技能已升至最高级") if(PlayerPoints[id] >= multijumpcost && multijump[id] < multijumpmaxlvl) { multijump[id]++ upgradelevelup(id) decpoint(id,multijumpcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你现在能在空中多跳跃 %d 次", multijump[id]) } } case 6: { if(PlayerPoints[id] < dmgcost) client_print(id, print_chat, "【广东工业大学提醒你】 你没有足够的技能点") if(g_damageLevel[id] == MaxLevel_damage) client_print(id, print_chat, "【广东工业大学提醒你】 你的火力技能已升至最高级") if(PlayerPoints[id] >= dmgcost && g_damageLevel[id] < MaxLevel_damage) { g_damageLevel[id]++ upgradelevelup(id) decpoint(id,dmgcost) showMenu(id) client_print(id, print_chat, "【广东工业大学提醒你】 你提升了火力") } } case 8: MainUpgradesMenu(id) } return PLUGIN_HANDLED } add_experience(id, value) { if(PlayerLevel[id] <= Max_Level-1) { PlayerXp[id] += value } } public UserArmor(id, value) { new CsArmorType:ArmorType new iArmor = cs_get_user_armor(id, ArmorType) cs_set_user_armor(id, iArmor + value, ArmorType) return PLUGIN_CONTINUE } public UserHealth(id, value) { new iHealth = get_user_health(id) set_user_health(id, iHealth + value) return PLUGIN_CONTINUE } public UserSpeed(id) { if(speed == false) return PLUGIN_CONTINUE new ispeed = (Speed[id] * speedperbuy) set_user_maxspeed(id, 240.0 + ispeed) return PLUGIN_CONTINUE } public UserGravity(id) { set_user_gravity(id, 1 - Gravity[id] * gravityperbuy) return PLUGIN_CONTINUE } public UserStealth(id) { new istealth = (Stealth[id] * stealthperbuy) set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, defaultstealth - istealth) return PLUGIN_CONTINUE } public client_PreThink(id) { if(is_user_alive(id) && get_cvar_num("amx_upgrades") == 1) { new buttons = get_user_button(id) new obut = get_user_oldbutton(id) if(multijump[id] > 0) { if((buttons & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP)) { if(jumpnum[id] < multijump[id]) { dojump[id] = true jumpnum[id]++ return PLUGIN_CONTINUE } } if((buttons & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND)) jumpnum[id] = 0 } } return PLUGIN_CONTINUE } public client_PostThink(id) { if(is_user_alive(id) && get_cvar_num("amx_upgrades") == 1) { if(dojump[id] == true) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2] = random_float(265.0,285.0) entity_set_vector(id,EV_VEC_velocity,velocity) dojump[id] = false return PLUGIN_CONTINUE } } return PLUGIN_CONTINUE } public fw_TakeDamage(id, victim, inflictor, attacker, Float:damage, damage_type) { if (!is_user_alive(id) || attacker == inflictor) return HAM_IGNORED if (g_damageLevel[id] > 0) SetHamParamFloat(4, damage + 1000000) return HAM_IGNORED } SaveData(id) { new authid[32] get_user_authid(id, authid, 31) new vaultkey[64], vaultdata[64] format(vaultkey, 63, "Account-%s-Level", authid) format(vaultdata, 63, "%d", PlayerLevel[id]) set_vaultdata(vaultkey, vaultdata) format(vaultkey, 63, "Account-%s-Xp", authid) format(vaultdata, 63, "%d", PlayerXp[id]) set_vaultdata(vaultkey, vaultdata) format(vaultkey, 63, "Account-%s-Points", authid) format(vaultdata, 63, "%d", PlayerLevel[id]) set_vaultdata(vaultkey, vaultdata) } LoadData(id) { new authid[32] get_user_authid(id,authid,31) new vaultkey[64], vaultdata[64] format(vaultkey, 63, "Account-%s-Level", authid) get_vaultdata(vaultkey, vaultdata, 63) PlayerLevel[id] = str_to_num(vaultdata) format(vaultkey, 63, "Account-%s-Xp", authid) get_vaultdata(vaultkey, vaultdata, 63) PlayerXp[id] = str_to_num(vaultdata) format(vaultkey, 63, "Account-%s-Points", authid) get_vaultdata(vaultkey, vaultdata, 63) PlayerPoints[id] = str_to_num(vaultdata) } public update(id) { if(get_cvar_num("amx_upgrades") != 1) return PLUGIN_CONTINUE if(!is_user_alive(id)) return PLUGIN_CONTINUE set_user_gravity(id, 1 - Gravity[id] * gravityperbuy) if(speed != false) set_user_maxspeed(id, 240.0 + (Speed[id] * speedperbuy)) new temp[2] new istealth = (Stealth[id] * stealthperbuy) if(Stealth[id] > 0) { if(get_user_weapon(id, temp[0], temp[1]) == CSW_KNIFE) { new astealth = istealth + 20 set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, defaultstealth - astealth) } else set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, defaultstealth - istealth) } return PLUGIN_CONTINUE } public upgradelevelup(id) { client_print(id, print_center, "你该项技能已经提升") client_cmd(id, "spk weapons/pl_gun2.wav") return PLUGIN_CONTINUE } public plugin_precache() { precache_sound("weapons/pl_gun2.wav") precache_sound("buttons/blip2.wav") precache_sound("weapons/mine_charge.wav") precache_model("models/v_satchel_radio.mdl") precache_model("models/p_satchel_radio.mdl") precache_sound(DeniedSound) precache_sound(LevelUpSound) precache_sound(UpgradedSound) } public decpoint(id, itemcost) { new cost = itemcost PlayerPoints[id] = PlayerPoints[id] - cost return PLUGIN_HANDLED }
|