Some errors (bugs) how to fix?
Quote:
L 07/26/2011 - 22:00:47: [FUN] Player out of range (0)
L 07/26/2011 - 22:00:47: [AMXX] Displaying debug trace (plugin "test.amxx")
L 07/26/2011 - 22:00:47: [AMXX] Run time error 10: native error (native "strip_user_weapons")
L 07/26/2011 - 22:00:47: [AMXX] [0] test.sma::hns_start (line 3300)
|
PHP Code:
#define IsPlayer(%1) (1<=%1<=g_max_clients)
g_max_clients = get_maxplayers()
public hns_start() { for(new i = 0; i < g_max_clients; i++) { if(IsPlayer(i) && is_user_alive(i)) { switch(cs_get_user_team(i)) { case CS_TEAM_T: { strip_user_weapons(i) give_item(i, "weapon_hegrenade") give_item(i, "weapon_flashbang") give_item(i, "weapon_flashbang") give_item(i, "weapon_smokegrenade") set_user_health(i, 100) noflash[i]=true } case CS_TEAM_CT: { set_pev(i, pev_flags, (pev(i, pev_flags) & ~FL_FROZEN)) set_user_health(i, 100) } } } } return PLUGIN_CONTINUE }
2nd error
Quote:
L 07/26/2011 - 22:29:51: Plugin called message_begin with an invalid message id (0).
L 07/26/2011 - 22:29:51: [AMXX] Displaying debug trace (plugin "test.amxx")
L 07/26/2011 - 22:29:51: [AMXX] Run time error 10: native error (native "message_begin")
L 07/26/2011 - 22:29:51: [AMXX] [0] test.sma::FlashedEvent (line 3319)
|
PHP Code:
register_event("ScreenFade", "FlashedEvent", "be","4=255","5=255","6=255","7>199")
g_nMsgScreenFade = get_user_msgid("ScreenFade")
public FlashedEvent(i) { if(!noflash[i]) { return PLUGIN_CONTINUE } message_begin( MSG_ONE,g_nMsgScreenFade,{0,0,0},i ) write_short( read_data( 1 ) ) // Duration write_short( read_data( 2 ) ) // Hold time write_short( read_data( 3 ) ) // Fade type write_byte (0) // Red write_byte (0) // Green write_byte (0) // Blue write_byte (0) // Alpha message_end() return PLUGIN_HANDLED }
|