Raised This Month: $ Target: $400
 0% 

[Solved]Force spectator's m_hObserverTarget


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-15-2014 , 09:39   [Solved]Force spectator's m_hObserverTarget
Reply With Quote #1

I want to force m_hObserverTarget to be CT team only.

Quote:
Originally Posted by Arkshine View Post
... you just need to call CBasePlayer::Observer_FindNextPlayer. You can pass name as param.
Using the code below throws that error and the server shutdowns.
Code:
[AMXX] Forwards with more than 32 parameters are not supported (tried to prepare array # 33).
Code:
#include <amxmodx> #include <orpheu> #include <fakemeta> #include <engine> #define get_team(%0) ( get_pdata_int( %0, m_iTeam ) ) const m_iTeam = 114; const TEAM_CT = 2; new OrpheuFunction:Observer_FindNextPlayer; public plugin_init() {     Observer_FindNextPlayer = OrpheuGetFunction( "Observer_FindNextPlayer", "CBasePlayer" );         OrpheuRegisterHook( Observer_FindNextPlayer, "OnObserver_FindNextPlayer_Post" , OrpheuHookPost); } public  OnObserver_FindNextPlayer_Post( const player, const bool:searchDown, const playerNameToSearch[] ) {     static m_hObserverTarget; m_hObserverTarget = pev( player, pev_iuser2 );         if( get_team( m_hObserverTarget ) != TEAM_CT )     {         static id; id = m_hObserverTarget;         while ( (id = find_ent_by_class( id, "player" )) != m_hObserverTarget )         {             if(get_team( id ) != TEAM_CT )                 continue;                             static szName[32]; get_user_name(id, szName, charsmax(szName));                         OrpheuCallSuper( Observer_FindNextPlayer, player, searchDown, szName );                         break;         }     } }

Last edited by SpeeDeeR; 06-16-2014 at 20:27.
SpeeDeeR is offline
 


Thread Tools
Display Modes

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 21:15.


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