Raised This Month: $ Target: $400
 0% 

[Solved]Force spectator's m_hObserverTarget


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-15-2014 , 14:04   Re: [Orpheu] Force spectator's m_hObserverTarget
Reply With Quote #2

Well something is wrong. Make sure your code is alright so Orpheu won't get problems. If your code is alright and you are still getting this error, either Orpheu or your currently version of AMX Mod X have problems.

Furthermore, try that with the latest AMX Mod X build on AMX Mod X Snapshots.

PHP Code:
#include <amxmodx>
#include <orpheu>
#include <fakemeta>

#define Invalid -1
#define Offset 114
#define Ct 2
#define Team(%0) pev_valid(%0) && is_user_connected(%0) ? get_pdata_int(%0, Offset) : Invalid;

new OrpheuFunction:g_pFindNextPlayer OrpheuFunction:Invalid;

public 
plugin_init()
{
 
g_pFindNextPlayer OrpheuGetFunction("FindNextPlayer""CBasePlayer");
 
 if (
g_pFindNextPlayer == OrpheuFunction:Invalid)
  
set_fail_state("g_pFindNextPlayer is Invalid!");
  
 
OrpheuRegisterHook(g_pFindNextPlayer"FindNextPlayer_Post"OrpheuHookPost);
}

public 
FindNextPlayer_Post(Playerbool:DownName[])
{
 static 
pObserver InvalidId InvalidTeamId InvalidPlayerName[32], Loops 0;
 
 if (!
is_user_connected(Player))
  return;

 
pObserver pev(Playerpev_iuser2);
 
TeamId Team(pObserver);
 
 if (
TeamId == Invalid)
  
set_fail_state("Invalid Team for pObserver?");

 else if (
TeamId != Ct)
 {
  
Loops 0;
  
Id pObserver

  while ((
Id engfunc(EngFunc_FindEntityByStringId"classname""player")) != pObserver
  {
   
TeamId Team(Id);

   if (
TeamId == Invalid)
     
set_fail_state("Invalid Team for Id?");

   else if (
TeamId != Ct
     continue;

   else if (++
Loops >= 32
     
log_to_file("Debug.LOG""Reached Loop #32");
    
   
get_user_name(IdPlayerNamecharsmax(PlayerName));

   
OrpheuCallSuper(g_pFindNextPlayerPlayerDownPlayerName);

   break;
  }  
 }

__________________

Last edited by claudiuhks; 06-15-2014 at 14:25.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
 



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