源码有问题帮忙看下
//-------------------装备套卡--------------------------------------------------
// 使用武器装备卡
public UseArmamentCard(taskid)
{
new id=taskid - 520913
// if (!pt_is_server_loaded() || !is_user_alive(id) || !is_user_connected(id))
if (!is_user_alive(id) || !is_user_connected(id) || (g_roundCount < 3 && !get_cvar_num("PK_Mode_Open")))
{
return PLUGIN_CONTINUE
}
// 如果非混战标准或者娱乐服, 则退出
if ((server_type != 1 && server_type != 3 && server_type != 15) || !pt_get_user_card(id, ZBCARD))
// if (!pt_get_user_card(id, ZBCARD))
{
return PLUGIN_CONTINUE
}
new weapons[32],count,Msg[191],pos
new playerTeam = get_user_team(id)
get_user_weapons(id, weapons, count)
pos+=formatex(Msg[pos], sizeof(Msg)-1-pos, "^x04* ^x03【装备卡】:自动装备 ^x04")
if (playerTeam == 1)
{
// 给予主武器
if (!user_has_weapon(id,CSW_AK47) && !has_weapon_pro(id))
{
fm_give_item(id,CSW_AK47)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 - pos, "AK47 ")
}
if (user_has_weapon(id,CSW_AK47))
{
new iEnt=getweaponid(id,"weapon_ak47")
fm_set_weapon_ammo(iEnt, 30)
fm_set_user_bpammo(id, CSW_AK47,90)
}
// 给予副武器
if (!user_has_weapon(id,CSW_DEAGLE) && (!has_weapon_sec(id) || user_has_weapon(id,CSW_GLOCK18)))
{
if (user_has_weapon(id,CSW_GLOCK18))
{
fm_strip_user_gun(id, CSW_GLOCK18)
}
fm_give_item(id,CSW_DEAGLE)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 -pos, "沙漠之鹰 ")
}
if (user_has_weapon(id,CSW_DEAGLE))
{
new iEnt=getweaponid(id,"weapon_deagle")
fm_set_weapon_ammo(iEnt, 7)
fm_set_user_bpammo(id, CSW_DEAGLE,35)
}
}
else if (playerTeam == 2)
{
if (!user_has_weapon(id,CSW_M4A1) && !has_weapon_pro(id))
{
fm_give_item(id,CSW_M4A1)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 - pos, "M4A1 ")
}
if (user_has_weapon(id,CSW_M4A1))
{
new iEnt=getweaponid(id,"weapon_m4a1")
fm_set_weapon_ammo(iEnt, 30)
fm_set_user_bpammo(id, CSW_M4A1,90)
}
// 给予副武器
if (!user_has_weapon(id,CSW_DEAGLE) && (!has_weapon_sec(id) || user_has_weapon(id,CSW_USP)))
{
if (user_has_weapon(id,CSW_USP))
{
fm_strip_user_gun(id, CSW_USP)
}
fm_give_item(id,CSW_DEAGLE)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 - pos, "沙漠之鹰 ")
}
if (user_has_weapon(id,CSW_DEAGLE))
{
new iEnt=getweaponid(id,"weapon_deagle")
fm_set_weapon_ammo(iEnt, 7)
fm_set_user_bpammo(id, CSW_DEAGLE, 35)
}
}
else
{
// 玩家没有加入战斗, 不是恐怖份子, 也不是反恐, 则退出
// client_print(id, print_chat, "没有正确选择队伍!");
return PLUGIN_CONTINUE
}
// 设置防弹衣+头盔
fm_set_user_armor(id,100,2)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 - pos, "护甲 ")
// 给予玩家手雷
if (!fm_get_user_bpammo(id, CSW_HEGRENADE))
{
fm_give_item(id, CSW_HEGRENADE)
fm_set_user_bpammo(id, CSW_HEGRENADE, 1)
pos+=formatex(Msg[pos], sizeof(Msg) - 1 - pos, "手雷 ")
}
color_text(id, id, Msg)
return PLUGIN_CONTINUE
}
public event_round_start()
{
g_roundCount ++
g_roundtime=get_gametime()
}
|