| BigDontCry |
11-21-2007 03:25 |
DeathMsg shows suicide [Solved]
Hi.
I have a little problem... I'm trying to make a deathmsg show when someone is killed by a ultimate. First of all, it show that the killed player made a "suicide", then it shows that the killer killed the vicitm (as it should)... How do I get rid of the suicide message?
Here's my code:
PHP Code:
public check_ultimates() { new players[32], numplayers get_players(players, numplayers) new id for(new i = 0; i < numplayers; i++) { id = players[i] if(!ultimate_used[id] && is_user_alive(id) && !freezetime && !u_delay) { set_hudmessage(255, 0, 0, 0.02, 0.70, 1, 0.01, 0.01,_,_,-1) show_hudmessage(id, "[ Ultimate Ready ]") } } } public cast_ultimate(id) { if(freezetime) { client_print(id, print_chat, "[%s] You can't use your ultimate during freezetime", MOD) return PLUGIN_CONTINUE } if(u_delay) { set_hudmessage(255, 255, 255, -1.0, 0.7, 0, 6.0, 4.0,_,_,-1) show_hudmessage(id, "You can't use your ultimate the first 10 seconds of a round") return PLUGIN_CONTINUE } if(!is_user_alive(id)) { return PLUGIN_CONTINUE } if(ultimate_used[id]) { client_print(id, print_center, "[%s] You can't use your ultimate yet", MOD) return PLUGIN_CONTINUE } new origin[3] get_user_origin(id, origin) for(new i = 0; i < 3; i++) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_BEAMCYLINDER) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2] + 400) write_short(g_shockwave) write_byte(0) write_byte(0) write_byte(10) // Life write_byte(64) // Width write_byte(255) // Noise write_byte(230) // Red write_byte(70) // Green write_byte(0) // Blue write_byte(255) // Brightness write_byte(0) // Scrollspeed message_end() } new players[32], numplayers get_players(players, numplayers) new i, targetid, distance, targetorigin[3], damage, multiplier for(i = 0; i < numplayers; i++) { targetid = players[i] get_user_origin(targetid, targetorigin) distance = get_distance(origin, targetorigin) if(distance <= 400 && get_user_team(targetid) != get_user_team(id)) { multiplier = (80 * 80) / 400 damage = (400 - distance) * multiplier damage = sqrt(damage) if(is_user_alive(targetid)) { // Shake Screen message_begin(MSG_ONE, gmsgShake, {0,0,0}, targetid) write_short(255<<14) write_short(10<<14) write_short(255<<14) message_end() // Fade Screen message_begin(MSG_ONE, gmsgFade, {0,0,0}, targetid) write_short(1<<12) write_short(1<<8) write_short(1<<0) write_byte(230) write_byte(70) write_byte(0) write_byte(200) message_end() set_user_health(targetid, get_user_health(targetid) - damage) if(get_user_health(targetid) <= 0) { message_begin(MSG_ALL, gmsgDeathMsg, {0,0,0}, 0) write_byte(id) write_byte(targetid) write_byte(0) write_string("shockwave") message_end() set_user_frags(id, get_user_frags(id) + 1) set_user_frags(targetid, get_user_frags(id) + 1) } } } } emit_sound(id,CHAN_AUTO, "debris/beamstart7.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) ultimate_used[id] = true set_task(38.0, "recharge_ultimate", id) return PLUGIN_CONTINUE } public activate_ultimate(id) { ultimate_used[id] = false } public recharge_ultimate(id) { if(!ultimate_used[id]) { return PLUGIN_CONTINUE } set_hudmessage(255, 170, 0, -1.0, 0.65, 0, 6.0, 1.8,_,_,-1) show_hudmessage(id, "[ Recharging Ultimate. Please Wait... ]") message_begin(MSG_ONE, gmsgBartimer, {0,0,0}, id) write_byte(2) write_byte(0) message_end() set_task(2.0, "activate_ultimate", id) return PLUGIN_CONTINUE } public sqrt(num) { new div = num new result = 1 while (div > result) { // end when div == result, or just below div = (div + result) / 2 // take mean value as new divisor result = num / div } return div }
|