Raised This Month: $ Target: $400
 0% 

[solved] spectator change player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-09-2009 , 08:11   [solved] spectator change player
Reply With Quote #1

Well, I found a code that can detect if a player spectates in a certain mode... but not if he switches the player in that mode, what's the best way to detect WHEN a spectator views another player than the old one in the same spec mode ?

the code I got 'till now:
PHP Code:
register_message(get_user_msgid("TextMsg"), "msg_textMsg")
//...
 
public msg_textMsg(msgiddestid)
{
    static 
msg[32]
    
get_msg_arg_string(2msg31)
 
    if(
equali(msg"#Spec_Mode4"))
        
client_print(0print_chat"[debug] %s spectating %s in %d mode"get_player_name(id), get_player_name(entity_get_int(idEV_INT_iuser2)), entity_get_int(idEV_INT_iuser1))
 
    return 
PLUGIN_CONTINUE

and I debugged the textmsg, doesn't trigger when I change a player...
__________________
Hunter-Digital is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-10-2009 , 12:10   Re: spectator change player
Reply With Quote #2

Well, I just maked a global thinking entity and checked every time the user's 1&2 if they are any different from the ones 0.05 seconds ago :}

If anyone has an alternative better way, I'm all... eyes
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-10-2009 , 12:20   Re: spectator change player
Reply With Quote #3

See admin_sep player, or joaquim pseudo wallhack plugin, both use 2 event to detect spectated player.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-10-2009 , 16:48   Re: spectator change player
Reply With Quote #4

oohhh, forgot about those xD... aaaaand found it, the event is StatusValue ... testing it out thx

edit: yep, works fine, StatusValue and SpecHealth2 to update the player and TextMsg with arg2 at Spec_Mode to update the mode... :}
__________________

Last edited by Hunter-Digital; 05-10-2009 at 17:31.
Hunter-Digital is offline
Reply



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 13:56.


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