Witam proszę o poprawienie błędów w pluginie
#include <amxmodx> #include <amxmisc> #include <colorchat> #include <cstrike> #include <engine> #include <fakemeta> #include <fun> #include <codmod> #define PLUGIN "Bonusowe Paczki" #define VERSION "1.0" #define AUTHOR "radim edytowal ReVolta" new const modelitem[] = "models/cod_paczka.mdl"; new const prefix[] = "^04[BONUS]^01" public plugin_init() { register_plugin(PLUGIN, AUTHOR, VERSION) register_forward(FM_Touch, "fwd_touch") register_event("DeathMsg", "DeathMsg", "a") register_logevent("PoczatekRundy", 2, "1=Round_Start"); } public plugin_precache() { precache_model(modelitem); } public PoczatekRundy() kill_all_entity("paczka") public DeathMsg() { new kid = read_data(1) new vid = read_data(2) if( kid == vid ) return PLUGIN_CONTINUE; if(is_user_connected(kid) || is_user_connected(vid)) create_itm(vid, 0) return PLUGIN_CONTINUE; } public UzyjPaczki(id) { if( !is_user_connected(id) || !is_user_alive(id) ) return PLUGIN_HANDLED; switch(random_num(1, 5)) { case 1: { new hp = get_user_health(id); new losowehp = random_num(-5, -20); set_user_health(id, hp+losowehp) ColorChat(id, GREY, "^x04%s ^x01Znalazles trucizne. Tracisz ^x03%i^x01 HP!", prefix, losowehp) } case 2: { new hp = get_user_health(id); new losowehp = random_num(5, 40); set_user_health(id, hp+losowehp) ColorChat(id, GREY, "^x04%s ^x01Znalazles apteczke. Dostales ^x03%i^x01 HP!", prefix, losowehp) } case 3: { new kasa = cs_get_user_money(id); new losowakasa = random_num(20, 5000); cs_set_user_money(id, kasa+losowakasa) ColorChat(id, GREY, "^x04%s ^x01Znalazles sakiewke ze zlotem. Dostales ^x03%i^x01 kasy!", prefix, losowakasa) } case 4: { new frags = get_user_frags(id); new losowefrags = random_num(2, 4); get_user_frags(id, frags+losowefrags) ColorChat(id, GREY, "^Dostales ^x03%i^x01 kille!", prefix, losowefrags) } return PLUGIN_HANDLED; } public create_itm(id, id_item){ new Float:origins[3] pev(id,pev_origin,origins); new entit=create_entity("info_target") origins[0]+=50.0 origins[2]-=32.0 set_pev(entit,pev_origin,origins) entity_set_model(entit,modelitem) set_pev(entit,pev_classname,"paczka"); dllfunc(DLLFunc_Spawn, entit); set_pev(entit,pev_solid,SOLID_BBOX); set_pev(entit,pev_movetype,MOVETYPE_FLY); engfunc(EngFunc_SetSize,entit,{-1.1, -1.1, -1.1},{1.1, 1.1, 1.1}); engfunc(EngFunc_DropToFloor,entit); set_pev(entit, pev_iuser1, id_item) } public fwd_touch(ent,id) { if(!is_user_alive(id)) return FMRES_IGNORED; if(!pev_valid(ent)) return FMRES_IGNORED; static classname[32]; pev(ent,pev_classname,classname,31); if(!equali(classname,"paczka")) return FMRES_IGNORED; if(pev(id,pev_button)) { { UzyjPaczki(id) engfunc(EngFunc_RemoveEntity,ent); } } return FMRES_IGNORED; } public kill_all_entity(classname[]) { new iEnt = find_ent_by_class(-1, classname) while(iEnt > 0) { remove_entity(iEnt) iEnt = find_ent_by_class(iEnt, classname) } }
A oto errory:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team paczki.sma(84) : error 088: number of arguments does not match definition paczki.sma(85) : error 027: invalid character constant paczki.sma(89) : error 002: only a single statement (or expression) can follow each "case" paczki.sma(89) : warning 215: expression has no effect paczki.sma(90) : warning 209: function "UzyjPaczki" should return a value paczki.sma(134) : warning 217: loose indentation 3 Errors. Could not locate output file paczki.amxx (compile failed).