Raised This Month: $ Target: $400
 0% 

ID error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 05-23-2010 , 15:01   Re: ID error
Reply With Quote #1

Quote:
Originally Posted by edgaras85 View Post
Error :

PHP Code:
public ShowMessage( ) {
    new 
iPlayers32 ], iNumTEAMS ];
    
//get_players( iPlayers, iNum[ TE ], "ae", "TERRORIST" );
    
get_playersiPlayersiNumCT ], "ae""CT" );
 
    if( 
iNumTE ] > || iNumCT ] > ) {
        new 
iCvarsCVARS ];
 
        
iCvarsRED      ] = get_pcvar_numg_pCvarsRED      ] );
        
iCvarsGREEN    ] = get_pcvar_numg_pCvarsGREEN    ] );
        
iCvarsBLUE     ] = get_pcvar_numg_pCvarsBLUE     ] );
        
iCvarsLOCATION ] = get_pcvar_numg_pCvarsLOCATION ] );
 
        if( 
iCvarsLOCATION ] > sizeofg_flCoords ) - ) {
            
set_pcvar_numg_pCvarsLOCATION ], );
 
            
iCvarsLOCATION ] = 1;
        }
 
        
set_hudmessageiCvarsRED ], iCvarsGREEN ], iCvarsBLUE ], 
        
g_flCoordsiCvarsLOCATION ] ][ ], g_flCoordsiCvarsLOCATION ] ][ ], 0HUD_STAYHUD_STAY0.00.0);
 
        
//show_hudmessage( 0, "Players Remaining^nTE: %i^nCT: %i", iNum[ TE ], iNum[ CT ] );
 
new CsTeams:iTeam cs_get_user_team(id);
 if (
iTeam == CS_TEAM_T)
  {
        
show_hudmessage(0"Counter-Terrorists Remaining: %i"iNumCT ] );
  }
 }
    }

What's the full code. I cannot help you if you don't provide more information.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 05-23-2010 , 15:07   Re: ID error
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#define DELAY 0.5
#define HUD_STAY DELAY + 0.1
enum _:CVARS {
   
RED,
   
GREEN,
   
BLUE,
   
LOCATION
};
enum _:TEAMS {
   
TE,
   
CT
};
new 
g_pCvarsCVARS ];
new const 
Float:g_flCoords[ ][ ] = {
   { 
0.02, -1.0 },
   { 
0.100.40 },
   { 
0.280.00 },
   { 
0.570.00 },
   { 
0.570.45 },
   { 
0.570.78 },
   { 
0.270.78 },
   { 
0.010.78 },
   { 
0.310.36 }
}
public 
plugin_init( ) {
   
register_plugin"Players Remaining""1.0""xPaw" );
   
   
g_pCvarsRED      ] = register_cvar"amx_pr_red",        "255" );
   
g_pCvarsGREEN    ] = register_cvar"amx_pr_green",      "0" );
   
g_pCvarsBLUE     ] = register_cvar"amx_pr_blue",       "0" );
   
g_pCvarsLOCATION ] = register_cvar"amx_pr_location",   "5" );
   
   new 
iEntity create_entity"info_target" );
   
   if( 
is_valid_entiEntity ) ) {
      
entity_set_stringiEntityEV_SZ_classname"PlayersRemainThinker" );
      
entity_set_floatiEntityEV_FL_nextthinkget_gametime( ) + DELAY );
      
      
register_think"PlayersRemainThinker""FwdThink" );
   } else
   
set_taskDELAY"ShowMessage"___"b" );
}
public 
FwdThinkiEntity ) {
   
ShowMessageiEntity );
   
   
entity_set_floatiEntityEV_FL_nextthinkget_gametime( ) + DELAY );
}
public 
ShowMessageid ) {
   new 
iPlayers32 ], iNumTEAMS ];
   
//get_players( iPlayers, iNum[ TE ], "ae", "TERRORIST" );
   
get_playersiPlayersiNumCT ], "ae""CT" );
   
   if( 
iNumTE ] > || iNumCT ] > ) {
      new 
iCvarsCVARS ];
      
      
iCvarsRED      ] = get_pcvar_numg_pCvarsRED      ] );
      
iCvarsGREEN    ] = get_pcvar_numg_pCvarsGREEN    ] );
      
iCvarsBLUE     ] = get_pcvar_numg_pCvarsBLUE     ] );
      
iCvarsLOCATION ] = get_pcvar_numg_pCvarsLOCATION ] );
      
      if( 
iCvarsLOCATION ] > sizeofg_flCoords ) - ) {
         
set_pcvar_numg_pCvarsLOCATION ], );
         
         
iCvarsLOCATION ] = 1;
      }
      
      
set_hudmessageiCvarsRED ], iCvarsGREEN ], iCvarsBLUE ], 
      
g_flCoordsiCvarsLOCATION ] ][ ], g_flCoordsiCvarsLOCATION ] ][ ], 0HUD_STAYHUD_STAY0.00.0);
      
      
//show_hudmessage( 0, "Players Remaining^nTE: %i^nCT: %i", iNum[ TE ], iNum[ CT ] );
      
if(is_user_connected(id)) {
         new 
CsTeams:iTeam cs_get_user_team(id);
         if (
iTeam == CS_TEAM_T)
         {
            
show_hudmessage(0"Counter-Terrorists Remaining: %i"iNumCT ] );
         }
      }
   }

edgaras85 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-23-2010 , 16:40   Re: ID error
Reply With Quote #3

As wrecked said. You forgot to copy something. The edit that you made (replacing show_hudmessage) is almost competely wrong.
__________________

Last edited by fysiks; 05-23-2010 at 17:04.
fysiks is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 05-23-2010 , 16:46   Re: ID error
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
As wrecked said. You forgot to copy something. The edit that you made (replacing show_hudmessage) is almost competely wrong.

My suggestion if you are uncapable of doing anything but copy and pasting is to make sure that it works correctly after copy/pasting before you edit things.
It is all plugin
I only added if team T
all was there
and some added what XUlos said...
edgaras85 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-23-2010 , 16:56   Re: ID error
Reply With Quote #5

Quote:
Originally Posted by edgaras85 View Post
It is all plugin
Oops, I missed how it was doing the counting . Just a sec and I will edit it.

EDIT:

Code:
public FwdThink(iEntity) {     ShowMessage();         entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + DELAY ); } public ShowMessage() {     new iPlayers[ 32 ], iNum[ TEAMS ];     get_players( iPlayers, iNum[ CT ], "ae", "CT" );     get_players( iPlayers, iNum[ TE ], "ae", "TERRORIST" );         if( iNum[ TE ] > 0 || iNum[ CT ] > 0 )     {         new iCvars[ CVARS ];                 iCvars[ RED ] = get_pcvar_num( g_pCvars[ RED ] );         iCvars[ GREEN ] = get_pcvar_num( g_pCvars[ GREEN ] );         iCvars[ BLUE ] = get_pcvar_num( g_pCvars[ BLUE ] );         iCvars[ LOCATION ] = get_pcvar_num( g_pCvars[ LOCATION ] );                 if( iCvars[ LOCATION ] > sizeof( g_flCoords ) - 1 ) {             set_pcvar_num( g_pCvars[ LOCATION ], 1 );                         iCvars[ LOCATION ] = 1;         }                 set_hudmessage( iCvars[ RED ], iCvars[ GREEN ], iCvars[ BLUE ],         g_flCoords[ iCvars[ LOCATION ] ][ 0 ], g_flCoords[ iCvars[ LOCATION ] ][ 1 ], 0, HUD_STAY, HUD_STAY, 0.0, 0.0, 3 );                 for(new i = 0; i < iNum[TE]; i++)         {               show_hudmessage(iPlayers[i], "Counter-Terrorists Remaining: %i", iNum[ CT ] );         }     } }

There are TWO (2) infinite loops in this code! Both calling the same function!
__________________

Last edited by fysiks; 05-23-2010 at 17:10.
fysiks is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 05-23-2010 , 17:34   Re: ID error
Reply With Quote #6

VERY BIG Thanks
Works like a charm
edgaras85 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 05:26.


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