Problem skompilowania pluginu do ZP
ZyciE 10.08.2013
Witam , Mam plugin do zmiany Noktowizora ale ma jakieś błędy i nie moge go skompilować
#include <amxmodx> #include <cstrike> #include <fun> new const sound_nvg[2][] = {"items/nvg_off.wav", "items/nvg_on.wav"} public plugin_init() { register_clcmd("nightvision", "cmd_nightvision") } public cmd_nightvision(id) { if (!is_user_alive(id) || !zp_core_is_zombie[id]) return PLUGIN_HANDLED; if (!g_nvg[id]) { SwitchNvg(id, 1) client_cmd(id, "spk sound_nvg[1]") } else { SwitchNvg(id, 0) client_cmd(id, "spk sound_nvg[0]") } return PLUGIN_CONTINUE } public SwitchNvg(id, mode) { if (!is_user_connected(id)) return; g_nvg[id] = mode set_user_nvision(id) } public set_user_nvision(id) { if (!is_user_connected(id)) return; new alpha if (g_nvg[id]) alpha = 70 else alpha = 0 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id) write_short(0) // duration write_short(0) // hold time write_short(0x0004) // fade type write_byte(253) // r write_byte(110) // g write_byte(110) // b write_byte(alpha) // alpha message_end() if(g_nvg[id]) { set_player_light(id, "z") } else { set_player_light(id, cfg_default_light) } } public set_player_light(id, const LightStyle[]) { message_begin(MSG_ONE_UNRELIABLE, SVC_LIGHTSTYLE, .player = id) write_byte(0) write_string(LightStyle) message_end() }
Błędy :
Error: Undefined symbol "zp_core_is_zombie" on line 14 Warning: Expression has no effect on line 14 Error: Expected token: ";", but found "]" on line 14 Error: Invalid expression, assumed zero on line 14 Error: Too many error messages on one line on line 14
byCZUS
10.08.2013
client_cmd(id, "spk sound_nvg[0]") jak i client_cmd(id, "spk sound_nvg[1]") nie zadziała
nie kompiluje bo nie dodałeś biblioteki ZP do pluginu, a chcesz używać funkcji zp_core_is_zombie, do tego, źle jej używasz powinno być zp_core_is_zombie(id), nie zp_core_is_zombie[id] ...
client_cmd(id, "spk sound_nvg[0]") zamień na client_cmd(id, "spk %s", sound_nvg[0]) i to drugie tak samo ...
ZyciE 10.08.2013
Teraz błędy
Error: Undefined symbol "zp_core_is_zombie" on line 27 Error: Expected token: ")", but found "return" on line 27 Error: Undefined symbol "g_nvg" on line 31 Warning: Expression has no effect on line 31 Error: Expected token: ";", but found "]" on line 31 Error: Invalid expression, assumed zero on line 31 Error: Too many error messages on one line on line 31
Użytkownik ZyciE edytował ten post 10.08.2013 11:28