Прошу помощи в исправлении нескольких ошибок в Vipmenu!
|
|
ARTY | Дата: Вторник, 07.07.2015, 19:09 | Сообщение # 1 |
- Сообщения: 2
- Награды: 0
- Замечания:
|
В общем есть плагин vipmenu, при компиляции выдает несколько ошибок (большинство от одного кода - if(iNum [id]<= 0)) Помогите пожалуйста исправить! Заранее благодарен Код #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta> #include <engine> #include <hamsandwich>
#define VIP_ACCESS ADMIN_LEVEL_H
#define DAMAGE_RECIEVED
#define PLUGIN "Vips"
#define VERSION "3.0"
#define AUTHOR "zyxel" #define INUM1 1 new iNum[33]
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_ MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
new vip_damage, g_HudSync, g_roundCount, g_HudSync2, OnOffDamage[33], bool:Damage[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR) register_event("ResetHUD", "ResetHUD", "be"); register_event("HLTV", "event_round_start", "a", "1=0", "2=0") register_event("Damage", "eventDamage", "b", "2!0", "3=0", "4!0") register_logevent("event_new_round", 2, "1=Round_Start")
register_clcmd("say /vipmenu", "Menu");
register_clcmd("say_team /vipmenu", "Menu")
register_clcmd("damage", "ClCmdDamage");
vip_damage = register_cvar("vip_damage", "1");
g_HudSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
g_HudSync2 = CreateHudSyncObj()
#endif
}
public Event_GameRestart()
g_roundCount = 1
public round_end()
g_roundCount++
public client_putinserver(id)
{
if (get_user_flags(id) & (ADMIN_IMMUNITY|ADMIN_LEVEL_H))
set_task(0.1, "adminconnect", id)
OnOffDamage [id]= true
}
public adminconnect(id)
{
new name[32]
get_user_name(id, name, 31)
nChatPrint(0, "^4 [VIP]^1Присоединился - ^4%s^1", name)
} public logevent_round_start() { new iPlayers[32], iNums get_players(iPlayers, iNums) // Получаем игроков for(new i; i < iNums; i++) iNum[iPlayers[i]] = INUM1 // Устанавливаем число. }
public ResetHUD(id)
set_task(0.5, "VIP", id + 6910)
public VIP(TaskID)
{
new id = TaskID - 6910
if(is_user_admin(id))
{
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib")) write_byte(id) write_byte(4) message_end() give_item(id,"weapon_hegrenade") give_item(id,"weapon_flashbang") give_item(id,"weapon_smokegrenade") give_item(id,"item_assaultsuit") give_item(id,"item_thighpack")
}
return PLUGIN_HANDLED
}
public eventDamage(id) { new attacker = get_user_attacker(id) new damage = read_data(2) if(get_pcvar_num(vip_damage)) { if(is_user_connected(attacker) && is_user_connected(id)) { if(get_user_flags(attacker) & VIP_ACCESS && OnOffDamage[attacker]) { set_hudmessage(0, 100, 200, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(attacker, g_HudSync, "%i", damage) } if ( get_user_flags ( id ) & VIP_ACCESS && OnOffDamage[id]) { set_hudmessage(255, 0, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(id, g_HudSync2, "%i", damage) } } } }
public Menu(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{ new msg[222], name[32] get_user_name(id, name, 31) formatex(msg, charsmax(msg), "\rВ\wип меню \d[\r4istii Kaif_18+\d]^n\rИ\wмя игрока: \d%s", name) new menu = menu_create(msg, "menu_handler") menu_additem(menu, "\wВзять \r[\yDeagle\r]", "1", 0) menu_additem(menu, "\wВзять \r[\yAK-47\r]", "2", 0) menu_additem(menu, "\wВзять \r[\yM4a1\r]", "3", 0) menu_additem(menu, "\wВзять \r[\yAWP\r]", "4", 0) menu_additem(menu, "\wВзять \r[\yFAMAS\r]", "5", 0) if(Damage [id]== true)
menu_additem(menu,"\wДамагер: \rВыключен", "6", 0) else menu_additem(menu,"\wДамагер: \yВключен", "6", 0) menu_setprop(menu, MPROP_NEXTNAME, "\rДальше") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "\rВыход") menu_display(id, menu, 0)
}
else nChatPrint(id,"^4 [VIP]^1Вы еще не купили VIP права ^4Цена 150р - подробнее vk.com/4istiikaif")
return PLUGIN_HANDLED
}
public menu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64], name[32]
new access, callback
get_user_name(id, name, 31)
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(is_user_alive(id))
{
drop_weapons(id, 2)
give_item(id,"weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
nChatPrint(id, "^1Ты взял(а) ^4deagle", name)
}
}
case 2:
{
if(g_roundCount < 3)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_ak47") cs_set_user_bpammo(id, CSW_AK47, 90) nChatPrint(id,"^1Ты взял(а) ^4AK-47", name) iNum[id]-- //
}
case 3:
{
if(g_roundCount < 3)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_m4a1") cs_set_user_bpammo(id, CSW_M4A1, 90) nChatPrint(id,"^1Ты взял(а) ^4m4a1", name) iNum[id]-- //
}
case 4:
{
if(g_roundCount < 5)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 5 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_awp") cs_set_user_bpammo(id, CSW_AWP, 30) nChatPrint(id,"^1Ты взял(а) ^4AWP", name) iNum[id]-- //
} case 5:
{
if(g_roundCount < 3)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE }
drop_weapons(id, 1) give_item(id,"weapon_famas") cs_set_user_bpammo(id, CSW_FAMAS, 90) nChatPrint(id,"^1Ты взял(а) ^4FAMAS", name) iNum[id]-- //
}
case 6:
{
switch(Damage[id])
{
case true:
{
client_cmd(id, "damage")
nChatPrint(id,"^4 [VIP]^1Ты ^3%s^1 включил(а) ^4damage^1!", name)
Damage [id]= false
Menu(id)
}
case false:
{
client_cmd(id, "damage")
nChatPrint(id,"^4 [VIP]^1Ты ^3%s^1 выключил(а) ^4damage^1!", name)
Damage [id]= true
Menu(id)
}
}
}
}
return PLUGIN_HANDLED
}
stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons
[i]if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}
stock nChatPrint(const id, const input[], any:...)
{
new nCount = 1, nNum[32]
static nMsgs[191]
vformat(nMsgs, 190, input, 3)
replace_all(nMsgs, 190, "!g", "^4")
replace_all(nMsgs, 190, "!n", "^1")
replace_all(nMsgs, 190, "!t", "^3")
if(id) nNum[0] = id; else get_players(nNum, nCount, "ch")
{
for(new i = 0; i < nCount; i++)
{
if(is_user_connected(nNum[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, nNum[i])
write_byte(nNum[i])
write_string(nMsgs)
message_end()
}
}
}
}
public ClCmdDamage(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if(OnOffDamage[id])
OnOffDamage [id]= false
else
OnOffDamage [id]= true
}
return 0
}
|
|
| |
SMaster | Дата: Вторник, 07.07.2015, 20:14 | Сообщение # 2 |
- Сообщения: 2189
- Награды: 46
- Замечания:
|
Код #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta> #include <engine> #include <hamsandwich> #include <amxconst.inc>
#pragma tabsize 0
#define VIP_ACCESS ADMIN_LEVEL_H
#define DAMAGE_RECIEVED
#define PLUGIN "Vips"
#define VERSION "3.0"
#define AUTHOR "zyxel" #define INUM1 1 new iNum[33]
// Weapon bitsums const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_ MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
new vip_damage, g_HudSync, g_roundCount, g_HudSync2, OnOffDamage[33], bool:Damage[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR) register_event("ResetHUD", "ResetHUD", "be"); register_event("HLTV", "event_round_start", "a", "1=0", "2=0") register_event("Damage", "eventDamage", "b", "2!0", "3=0", "4!0") register_logevent("event_new_round", 2, "1=Round_Start")
register_clcmd("say /vipmenu", "Menu");
register_clcmd("say_team /vipmenu", "Menu")
register_clcmd("damage", "ClCmdDamage");
vip_damage = register_cvar("vip_damage", "1");
g_HudSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
g_HudSync2 = CreateHudSyncObj()
#endif
}
public Event_GameRestart()
g_roundCount = 1
public round_end()
g_roundCount++
public client_putinserver(id)
{
if (get_user_flags(id) & (ADMIN_IMMUNITY|ADMIN_LEVEL_H))
set_task(0.1, "adminconnect", id)
OnOffDamage [id]= true
}
public adminconnect(id)
{
new name[32]
get_user_name(id, name, 31)
nChatPrint(0, "^4 [VIP]^1Присоединился - ^4%s^1", name)
} public logevent_round_start() { new iPlayers[32], iNums get_players(iPlayers, iNums) // Получаем игроков for(new i; i < iNums; i++) iNum[iPlayers[i]] = INUM1 // Устанавливаем число. }
public ResetHUD(id)
set_task(0.5, "VIP", id + 6910)
public VIP(TaskID)
{
new id = TaskID - 6910
if(is_user_admin(id))
{
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib")) write_byte(id) write_byte(4) message_end() give_item(id,"weapon_hegrenade") give_item(id,"weapon_flashbang") give_item(id,"weapon_smokegrenade") give_item(id,"item_assaultsuit") give_item(id,"item_thighpack")
}
return PLUGIN_HANDLED
}
public eventDamage(id) { new attacker = get_user_attacker(id) new damage = read_data(2) if(get_pcvar_num(vip_damage)) { if(is_user_connected(attacker) && is_user_connected(id)) { if(get_user_flags(attacker) & VIP_ACCESS && OnOffDamage[attacker]) { set_hudmessage(0, 100, 200, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1) ShowSyncHudMsg(attacker, g_HudSync, "%i", damage) } if ( get_user_flags ( id ) & VIP_ACCESS && OnOffDamage[id]) { set_hudmessage(255, 0, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(id, g_HudSync2, "%i", damage) } } } }
public Menu(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{ new msg[222], name[32] get_user_name(id, name, 31) formatex(msg, charsmax(msg), "\rВ\wип меню \d[\r4istii Kaif_18+\d]^n\rИ\wмя игрока: \d%s", name) new menu = menu_create(msg, "menu_handler") menu_additem(menu, "\wВзять \r[\yDeagle\r]", "1", 0) menu_additem(menu, "\wВзять \r[\yAK-47\r]", "2", 0) menu_additem(menu, "\wВзять \r[\yM4a1\r]", "3", 0) menu_additem(menu, "\wВзять \r[\yAWP\r]", "4", 0) menu_additem(menu, "\wВзять \r[\yFAMAS\r]", "5", 0) if(Damage [id]== true)
menu_additem(menu,"\wДамагер: \rВыключен", "6", 0) else menu_additem(menu,"\wДамагер: \yВключен", "6", 0) menu_setprop(menu, MPROP_NEXTNAME, "\rДальше") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "\rВыход") menu_display(id, menu, 0)
}
else nChatPrint(id,"^4 [VIP]^1Вы еще не купили VIP права ^4Цена 150р - подробнее vk.com/4istiikaif")
return PLUGIN_HANDLED
}
public menu_handler(id, menu, item) {
if(item == MENU_EXIT) { menu_destroy(menu)
return PLUGIN_HANDLED }
new data[6], iName[64], name[32]
new access, callback
get_user_name(id, name, 31)
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1: {
if(is_user_alive(id)) { drop_weapons(id, 2)
give_item(id,"weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 35)
nChatPrint(id, "^1Ты взял(а) ^4deagle", name)
}
}
case 2: {
if(g_roundCount < 3) {
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED } if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_ak47") cs_set_user_bpammo(id, CSW_AK47, 90) nChatPrint(id,"^1Ты взял(а) ^4AK-47", name) iNum[id]-- // }
case 3:
{
if(g_roundCount < 3)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_m4a1") cs_set_user_bpammo(id, CSW_M4A1, 90) nChatPrint(id,"^1Ты взял(а) ^4m4a1", name) iNum[id]-- //
}
case 4:
{
if(g_roundCount < 5)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 5 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE } drop_weapons(id, 1) give_item(id,"weapon_awp") cs_set_user_bpammo(id, CSW_AWP, 30) nChatPrint(id,"^1Ты взял(а) ^4AWP", name) iNum[id]-- //
}
case 5:
{
if(g_roundCount < 3)
{
nChatPrint(id,"^4 [VIP]^1Это оружие доступно с^4 3 ^1раунда")
return PLUGIN_HANDLED
} if(iNum [id]<= 0) { nChatPrint(id,"^4 [VIP]^1Вы уже использовали.Подождите...") // выводим сообщение return PLUGIN_CONTINUE }
drop_weapons(id, 1) give_item(id,"weapon_famas") cs_set_user_bpammo(id, CSW_FAMAS, 90) nChatPrint(id,"^1Ты взял(а) ^4FAMAS", name) iNum[id]-- //
}
case 6:
{
switch(Damage[id])
{
case true:
{
client_cmd(id, "damage")
nChatPrint(id,"^4 [VIP]^1Ты ^3%s^1 включил(а) ^4damage^1!", name)
Damage [id]= false
Menu(id)
}
case false:
{
client_cmd(id, "damage")
nChatPrint(id,"^4 [VIP]^1Ты ^3%s^1 выключил(а) ^4damage^1!", name)
Damage [id]= true
Menu(id)
}
}
}
}
return PLUGIN_HANDLED
}
stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons[i]
if((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}
stock nChatPrint(const id, const input[], any:...)
{
new nCount = 1, nNum[32]
static nMsgs[191]
vformat(nMsgs, 190, input, 3)
replace_all(nMsgs, 190, "!g", "^4")
replace_all(nMsgs, 190, "!n", "^1")
replace_all(nMsgs, 190, "!t", "^3")
if(id) nNum[0] = id; else get_players(nNum, nCount, "ch")
{
for(new i = 0; i < nCount; i++)
{
if(is_user_connected(nNum[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, nNum[i])
write_byte(nNum[i])
write_string(nMsgs)
message_end()
}
}
}
}
public ClCmdDamage(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if(OnOffDamage[id])
OnOffDamage [id]= false
else
OnOffDamage [id]= true
}
return 0
}
Наша группа вконтакте http://vk.com/nano_world_cs
Контакты: ICQ 607786179 Skype xonahead
|
|
| |
ARTY | Дата: Вторник, 07.07.2015, 20:36 | Сообщение # 3 |
- Сообщения: 2
- Награды: 0
- Замечания:
|
Благодарю! Огромное спасибо. Долго бы я мудохолся ещё а то!
|
|
| |