AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Undefined Symbol (https://forums.alliedmods.net/showthread.php?t=126514)

edgaras85 05-10-2010 07:11

Undefined Symbol
 
PHP Code:

public resultsOfVote(tid){
 
gbVote=false;
 
 new 
giVotesOn=count(VOTE_ON);
 new 
giVotesOff=count(VOTE_OFF);
 
 
ColorChat(0,GREEN"[FreeRun]^x01 %L %L(%d) vs %L(%d)",LANG_SERVER,"FREERUN_RESULTS",LANG_SERVER,"YES",giVotesOn,LANG_SERVER,"NO"giVotesOff);
 
 if( 
giVotesOn == giVotesOff ){
  
ColorChat(0,GREEN"[FreeRun]^x01 %L",LANG_SERVER,"FREERUN_TIE");
  return;
 }
 
makeFreeRun((giVotesOn giVotesOff));
 
ColorChat(0,GREEN"[FreeRun]^x01 %L ^x03%L",LANG_SERVER,"FREERUN_WINOPTION",LANG_SERVERgbFreeRun?"YES":"NO");
}
makeFreeRun(bool:bFR=true){
 
gbFreeRun=bFR;
 
reset();
 
giRounds=0;
 
giTime=get_systime();
 
 if(
gbFreeRun){
  
set_hudmessage(02552550.02, -1.0);
  
show_hudmessage(0"FreeRun!");
  if (
is_user_aliveiPlayer )  &&  cs_get_user_teamiPlayer ) == CS_TEAM_T )
       {
     new 
iPlayers32 ], iNum;
            
get_playersiPlayersiNum"ae""CT" );
             for( new 
0iNumi++ )
              {
                   
StripWeaponsiPlayers] );
              }
      }
                 }
 


Where always undefined symbol "iPlayer"
I made this
PHP Code:

public resultsOfVote(tid,iPlayer){
 
gbVote=false;
 
 new 
giVotesOn=count(VOTE_ON);
 new 
giVotesOff=count(VOTE_OFF);
 
 
ColorChat(0,GREEN"[FreeRun]^x01 %L %L(%d) vs %L(%d)",LANG_SERVER,"FREERUN_RESULTS",LANG_SERVER,"YES",giVotesOn,LANG_SERVER,"NO"giVotesOff);
 
 if( 
giVotesOn == giVotesOff ){
  
ColorChat(0,GREEN"[FreeRun]^x01 %L",LANG_SERVER,"FREERUN_TIE");
  return;
 }
 
makeFreeRun((giVotesOn giVotesOff));
 
ColorChat(0,GREEN"[FreeRun]^x01 %L ^x03%L",LANG_SERVER,"FREERUN_WINOPTION",LANG_SERVERgbFreeRun?"YES":"NO");
}
makeFreeRun(bool:bFR=true){
 
gbFreeRun=bFR;
 
reset();
 
giRounds=0;
 
giTime=get_systime();
 
 if(
gbFreeRun){
  
set_hudmessage(02552550.02, -1.0);
  
show_hudmessage(0"FreeRun!");
  if (
is_user_aliveiPlayer )  &&  cs_get_user_teamiPlayer ) == CS_TEAM_T )
       {
     new 
iPlayers32 ], iNum;
            
get_playersiPlayersiNum"ae""CT" );
             for( new 
0iNumi++ )
              {
                   
StripWeaponsiPlayers] );
              }
    }
       }
 


still error...

Bugsy 05-10-2010 10:02

Re: Undefined Symbol
 
In the first function, replace iPlayer with tid in is_user_alive and wherever else it may be used. I didn't evaluate what this function does but see if that solves your problem.

edgaras85 05-10-2010 14:45

Re: Undefined Symbol
 
PHP Code:

public resultsOfVote(tid){
 
gbVote=false;
 
 new 
giVotesOn=count(VOTE_ON);
 new 
giVotesOff=count(VOTE_OFF);
 
 
ColorChat(0,GREEN"[FreeRun]^x01 %L %L(%d) vs %L(%d)",LANG_SERVER,"FREERUN_RESULTS",LANG_SERVER,"YES",giVotesOn,LANG_SERVER,"NO"giVotesOff);
 
 if( 
giVotesOn == giVotesOff ){
  
ColorChat(0,GREEN"[FreeRun]^x01 %L",LANG_SERVER,"FREERUN_TIE");
  return;
 }
 
makeFreeRun((giVotesOn giVotesOff));
 
ColorChat(0,GREEN"[FreeRun]^x01 %L ^x03%L",LANG_SERVER,"FREERUN_WINOPTION",LANG_SERVERgbFreeRun?"YES":"NO");
}
makeFreeRun(bool:bFR=true){
 
gbFreeRun=bFR;
 
reset();
 
giRounds=0;
 
giTime=get_systime();
 
 if(
gbFreeRun){
  
set_hudmessage(02552550.02, -1.0);
  
show_hudmessage(0"FreeRun!");
  if (
is_user_alivetid )  &&  cs_get_user_teamtid ) == CS_TEAM_T )
       {
     new 
iPlayers32 ], iNum;
            
get_playersiPlayersiNum"ae""CT" );
             for( new 
0iNumi++ )
              {
                   
StripWeaponsiPlayers] );
              }
      }
                 }
 


Now "tid" undefined symbol....

Bugsy 05-10-2010 16:50

Re: Undefined Symbol
 
Oops, I didnt notice there were two separate functions. Ill take a look when I get home.

fysiks 05-10-2010 18:18

Re: Undefined Symbol
 
I'm assuming that you would need the alive and team check inside the loop and then iPlayer = iPlayers[i] before the if().

Bugsy 05-10-2010 19:20

Re: Undefined Symbol
 
Before I look at the code, please explain exactly what it does (be specific). It appears it is supposed to strip all CT player weapons if BFR/gbFreeRun is true?

edgaras85 05-11-2010 07:38

Re: Undefined Symbol
 
Quote:

Originally Posted by Bugsy (Post 1176856)
Before I look at the code, please explain exactly what it does (be specific). It appears it is supposed to strip all CT player weapons if BFR/gbFreeRun is true?

Yes its strips ct's weapons When is Free Run on deathrun

Bugsy 05-11-2010 09:00

Re: Undefined Symbol
 
Try that (untested)
PHP Code:

makeFreeRunbool:bFR=true )
{
    
gbFreeRun bFR;
    
reset();
    
giRounds 0;
    
giTime get_systime();

    if( 
bFR )
    {
        
set_hudmessage(02552550.02, -1.0);
        
show_hudmessage(0"FreeRun!");

        new 
iPlayers32 ], iNum;
        
get_playersiPlayersiNum"ae""CT" );
        
        for( new 
0iNumi++ )
        {
            
StripWeaponsiPlayers] );
        }
    }




All times are GMT -4. The time now is 03:37.

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