Raised This Month: $ Target: $400
 0% 

Check if player WAS alive when he join spectator team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mlk27
Veteran Member
Join Date: May 2008
Old 01-07-2009 , 07:26   Re: Check if player is alive when he join spectator team
Reply With Quote #10

im starting to think that this isn't possible =\ when you join spec, you'll definately be killed so hooking DeathMsg event to check if player was still alive before he joins spectator is kinda pointless cause it will always return false there..

Code:
#include <amxmodx> #include <fakemeta> new bool:g_bAlive[33] public plugin_init() {     register_plugin("Bad Frag for Evader", "0.1", "Me")     register_event("TeamInfo", "Event_JoinTeam", "a")     register_event("DeathMsg", "Event_Death", "a")     register_event("ResetHUD", "Event_ResetHud", "b") } public client_disconnect(id) {     if(!is_user_bot(id))     {         g_bAlive[id] = false         log_to_file("evade.log", "client_disconnect: %s", g_bAlive[id] ? "true" : "false")     } } public Event_ResetHud(id) {     if(!is_user_bot(id))     {         g_bAlive[id] = bool:(is_user_alive(id))         log_to_file("evade.log", "Event_ResetHud: %s", g_bAlive[id] ? "true" : "false")     } } public Event_Death() {     new id = read_data(2)           if(!is_user_bot(id))     {         g_bAlive[id] = bool:(is_user_alive(id))         log_to_file("evade.log", "Event_Death: %s", g_bAlive[id] ? "true" : "false")     } } public Event_JoinTeam() {     new id = read_data(1)     static user_team[32]     read_data(2, user_team, charsmax(user_team))     if(user_team[0] == 'S' && g_bAlive[id])     {         g_bAlive[id] = false         log_to_file("evade.log", "Entered spec")     }     return PLUGIN_CONTINUE; }

evade.log
Code:
L 01/07/2009 - 01:21:29: Log file started (file "cstrike\addons\amxmodx\logs\evade.log") (game "cstrike") (amx "1.8.0.3660")
L 01/07/2009 - 01:21:29: Event_ResetHud: false
L 01/07/2009 - 01:21:32: Event_ResetHud: true
L 01/07/2009 - 01:21:40: Event_ResetHud: true
L 01/07/2009 - 01:21:54: Event_Death: false
L 01/07/2009 - 01:22:04: client_disconnect: false
any more ideas?

Last edited by Mlk27; 01-07-2009 at 07:29.
Mlk27 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode