Witam bawię się z silnikiem pb i natknąłem się na pewien problem mianowicie przy dodaniu innej broni wywala serwer
Błąd
L 10/20/2018 - 19:03:16: [AMXX] Displaying debug trace (plugin "paintballgun.amxx") L 10/20/2018 - 19:03:16: [AMXX] Run time error 4: index out of bounds L 10/20/2018 - 19:03:16: [AMXX] [0] paintballgun (1) (3).sma::ham_primaryattack (line 206) L 10/20/2018 - 19:03:16: FATAL ERROR (shutting down): New message started when msg '35' has not been sent yet FATAL ERROR (shutting down): New message started when msg '35' has not been sent yet
public ham_primaryattack
public ham_primaryattack(ent) { new id = pev(ent, pev_owner); new my_pbgun = user_has_pbgun(id); if(my_pbgun) { new ammo = cs_get_weapon_ammo(ent); if(ammo) { new Float:gametime = get_gametime(), Float:g_speed; if(my_pbgun == 1) g_speed = get_pcvar_float(cvar[SPEED]); else g_speed = (my_pbgun == 2)? get_pcvar_float(cvar[SPEED]) * 2.0: get_pcvar_float(cvar[SPEED]) * 3.0; if(gametime - lastshot[id] > g_speed && (is_user_bot(id) || nextattack[id] < 0.0) && !freezetime) { if(paint_fire(id)) { lastshot[id] = gametime; cs_set_weapon_ammo(ent, ammo - 1); set_pev(id, pev_punchangle, Float:{-0.5, 0.0, 0.0}); message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id); write_byte(g_shot_anim[my_pbgun]); write_byte(0); message_end(); if(get_pcvar_num(cvar[SOUND])) emit_sound(id, CHAN_AUTO, "misc/pbg.wav", 1.0, ATTN_NORM, 0, PITCH_NORM); } } } } return HAM_SUPERCEDE; }
a dokładnie chodzi o linijkę
write_byte(g_shot_anim[my_pbgun]);