- Ошибка
-
zp_human_classes.sma(90) : warning 217: loose indentation
zp_human_classes.sma(96) : warning 217: loose indentation
zp_human_classes.sma(108) : warning 217: loose indentation
zp_human_classes.sma(108) : error 029: invalid expression, assumed zero
zp_human_classes.sma(108) : error 017: undefined symbol "menu_handler"
zp_human_classes.sma(110) : warning 209: function "open_menu" should return a value
zp_human_classes.sma(111) : error 017: undefined symbol "key"
zp_human_classes.sma(112) : error 017: undefined symbol "classGerrard"
zp_human_classes.sma(113) : error 017: undefined symbol "classDavid"
zp_human_classes.sma(114) : error 017: undefined symbol "classAra"
zp_human_classes.sma(115) : error 017: undefined symbol "classSpade"
zp_human_classes.sma(116) : error 017: undefined symbol "classAdmin"
zp_human_classes.sma(117) : error 017: undefined symbol "classPremium"
zp_human_classes.sma(118) : warning 209: function "open_menu" should return a value
zp_human_classes.sma(120) : warning 225: unreachable code
zp_human_classes.sma(120) : error 029: invalid expression, assumed zero
zp_human_classes.sma(120) : error 017: undefined symbol "fw_TakeDamage"
zp_human_classes.sma(120) : error 017: undefined symbol "inflictor"
zp_human_classes.sma(120) : fatal error 107: too many error messages on one line
- Компилятор
- WEB-компилятор
- Amx Mod X
- 1.9.0
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <zombieplague>
new SayText, g_maxplayers, g_class[33], g_speed[33]
/* Настройка текста */
#define ZP_PREFIX "!g[ZP]" // (ex. "[ZP] Text")
#define ZP_CHOOSE "!yТы выбрал !t[%s]" // (ex. "[ZP] You choose [Gerrard]")
#define ZP_NOT_ADMIN "!yНет прав на этот класс." // (ex. "[ZP] You have no access.")
#define PLUGIN_NAME "[ZP] Human Classes (1.0)"
#define PLUGIN_VERSION "1.0 - 29.08.2014"
#define PLUGIN_AUTHOR "TERKECOREJZ"
enum
{
CLASS_GERRARD,
CLASS_DAVIDBLACK,
CLASS_ARA,
CLASS_SPADE,
CLASS_ADMIN,
CLASS_PREMIUM,
CLASS_NULL
}
/* Флаг , чтобы взять "Spade" или "Choi Ji Yoon Limited" */
#define VIP_FLAG ADMIN_LEVEL_H
#define ADMIN_FLAG ADMIN_LEVEL_F
#define PREMIUM_FLAG ADMIN_LEVEL_G
/* Названия классов */
#define HUMAN_GERRARD "Джерард"
#define HUMAN_DAVIDBLACK "Девид"
#define HUMAN_ARA "СпецСлужба JRA"
#define HUMAN_SPADE "Футболист \r[VIP]"
#define HUMAN_ADMIN "Футболист \r[ADMIN]"
#define HUMAN_PREMIUM "Футболист \r[PREMIUM]"
public plugin_init() {
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd("hc", "open_menu")
register_dictionary("zombie_plague.txt")
register_event("HLTV", "Event_RoundNew", "a", "1=0", "2=0")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Spawn, "player", "Spawn_post", 1)
register_menucmd(register_menuid("Menu Classes"), 1023, "menu_handler")
SayText = get_user_msgid("SayText") ;}
public zp_user_humanized_post(id) open_menu(id)
public Spawn_post(id){
if(is_user_alive(id) && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id)){
open_menu(id)
return PLUGIN_HANDLED;}
return PLUGIN_HANDLED;}
/* Прикеш моделей */
public plugin_precache(){
engfunc(EngFunc_PrecacheModel, "models/player/gerrard/gerrard.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/davidblack/davidblack.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/ter1/ter1.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/vipzm/vipzm.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/admin/admin.mdl")
engfunc(EngFunc_PrecacheModel, "models/player/premium/premium.mdl");}
public client_connect(id)
if(is_user_connected(id))
g_class[id] = CLASS_GERRARD
public open_menu(id) {
new menu[512], len, keys = MENU_KEY_0
len += formatex(menu[len], charsmax(menu) - len, "Выбор Модели \r[ZP]^n^n")
len += formatex(menu[len], charsmax(menu) - len, "\r1. \w%s\w^n", HUMAN_GERRARD)
keys += MENU_KEY_1
len += formatex(menu[len], charsmax(menu) - len, "\r2. \w%s\w^n", HUMAN_DAVIDBLACK)
keys += MENU_KEY_2
len += formatex(menu[len], charsmax(menu) - len, "\r3. \w%s\w^n", HUMAN_ARA)
keys += MENU_KEY_3
if(get_user_flags(id) & VIP_FLAG){
len += formatex(menu[len], charsmax(menu) - len, "\r4. \w%s\w^n", HUMAN_SPADE)
keys += MENU_KEY_4
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r4. \w%s\w^n", HUMAN_SPADE)
keys += MENU_KEY_4
if(get_user_flags(id) & ADMIN_FLAG){
len += formatex(menu[len], charsmax(menu) - len, "\r5. \w%s\w^n", HUMAN_ADMIN)
keys += MENU_KEY_5
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r5. \w%s\w^n", HUMAN_ADMIN)
keys += MENU_KEY_5
if(get_user_flags(id) & PREMIUM_FLAG){
len += formatex(menu[len], charsmax(menu) - len, "\r6. \w%s\w^n", HUMAN_PREMIUM)
keys += MENU_KEY_6
} else {
len += formatex(menu[len], charsmax(menu) - len, "\r6. \w%s\w^n", HUMAN_PREMIUM)
keys += MENU_KEY_6;}
len += formatex(menu[len], charsmax(menu) - len, "^n\r0. \w%L", id, "Выйти.")
if (pev_valid(id) == 2) set_pdata_int(id, 205, 0, 5)
show_menu(id, keys, menu, -1, "Menu Classes")
return PLUGIN_HANDLED;}
public menu_handler(id, key){
if(!is_user_alive(id))
return;
switch (key) {
case 0: classGerrard(id)
case 1: classDavid(id)
case 2: classAra(id)
case 3: classSpade(id)
case 4: classAdmin(id)
case 5: classPremium(id);}
return;}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
if (victim != attacker && is_user_connected(attacker))
if(g_class[attacker] == CLASS_SPADE)
SetHamParamFloat(4, damage * 1.1)
public fw_CS_Player_ResetMaxSpeed(id) {
if(!is_user_alive(id) || !g_speed[id]) return HAM_IGNORED;
return HAM_SUPERCEDE;}
public Event_RoundNew()
for(new id = 1; id <= g_maxplayers; id++)
g_class[id] = CLASS_NULL
public classGerrard(id){
if(is_user_alive(id) && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_GERRARD
zp_override_user_model(id, "gerrard")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_GERRARD)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
public classDavid(id){
if(is_user_alive(id) && is_user_alive(id) && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_DAVIDBLACK
zp_override_user_model(id, "davidblack")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_DAVIDBLACK)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
public classAra(id){
if(is_user_alive(id) && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_ARA
zp_override_user_model(id, "ter1")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_ARA)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
public classSpade(id){
if(get_user_flags(id) & VIP_FLAG && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_SPADE
zp_override_user_model(id, "vipzm")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_SPADE)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
public classAdmin(id){
if(get_user_flags(id) & ADMIN_FLAG && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_ADMIN
zp_override_user_model(id, "admin")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_ADMIN)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
public classPremium(id){
if(get_user_flags(id) & PREMIUM_FLAG && is_user_connected(id) && !zp_get_user_zombie(id) && !zp_get_user_survivor(id) && !zp_get_user_nemesis(id)){
g_class[id] = CLASS_PREMIUM
zp_override_user_model(id, "premium")
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_CHOOSE, HUMAN_PREMIUM)
} else {
open_menu(id)
print_col_chat(id, "%s %s", ZP_PREFIX, ZP_NOT_ADMIN);} }
stock print_col_chat(const id, const input[], any:...){
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch");{
for ( new i = 0; i < count; i++ ) {
if ( is_user_connected(players[i]) ) {
message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();} } } }
Помогите с компилированием плагина, не компилируется, поставил копию других вип моделей ну тоесть добавил ADMIN, PREMIUM, не понимаю в чем дело, посмотрел ошибки в компилировании, но ничего не нашел.
За это не особо шарю, но до этого компиляция проходила, а сейчас незнаю что с этим.
p.s. я пользуюсь 1.8.2 и компилятор тоже 1.8.2
За это не особо шарю, но до этого компиляция проходила, а сейчас незнаю что с этим.
p.s. я пользуюсь 1.8.2 и компилятор тоже 1.8.2
Вложения
-
7.6 KB Просмотры: 41