Raised This Month: $51 Target: $400
 12% 

Solved weird error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farawayf
Senior Member
Join Date: Jan 2019
Old 05-03-2019 , 12:00   weird error
Reply With Quote #1

i dont understand what is the error
PHP Code:
stock bool CheckBEntity(int caller) {
    
char cname[64];
    
GetEntPropString(callerProp_Data"m_iName"cnamesizeof(cname));
    
    if (
StrEqual(cnameBuffer)) { //error "array (s do no match"
        
return true;
    }
    return 
false;


Last edited by farawayf; 05-03-2019 at 12:23.
farawayf is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-03-2019 , 12:04   Re: weird error
Reply With Quote #2

Quote:
Originally Posted by farawayf View Post
i dont understand what is the error
PHP Code:
stock bool CheckBEntity(int caller) {
    
char cname[64];
    
GetEntPropString(callerProp_Data"m_iName"cnamesizeof(cname));
    
    if (
StrEqual(cnameBuffer)) { //error "array (s do no match"
        
return true;
    }
    return 
false;

show how your setting Buffer...also what name are u trying to get...a players name? if its a players name...just use format string and within the format get the players name....but we need to see more to help u solve this.

Last edited by MasterMind420; 05-03-2019 at 12:07.
MasterMind420 is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-03-2019 , 12:12   Re: weird error
Reply With Quote #3

Quote:
Originally Posted by MasterMind420 View Post
show how your setting Buffer...
PHP Code:

char Buffer
[30][192];

public 
void OnMapStart() {
    for (
int i 0<= (30 1); i++)
        
Buffer[i] = "";

    
char cfgpath[PLATFORM_MAX_PATH];
    
char line[192];

    
BuildPath(Path_SMcfgpathsizeof(cfgpath), "configs/test/test.cfg");

    
Handle hFile OpenFile(cfgpath"r");

    if(
hFile != INVALID_HANDLE)
    {
        
int vline 0;
        while (!
IsEndOfFile(hFile))
        {
            if (!
ReadFileLine(hFilelinesizeof(line)))
                break;

            
TrimString(line);
            
Buffer[vline] = line;
            
vline++;
        }
        
CloseHandle(hFile);
    }


Quote:
Originally Posted by MasterMind420 View Post
also what name are u trying to get...a players name? if its a players name...just use format string and within the format get the players name....but we need to see more to help u solve this.
im trying to do a whitelist by entity names. i could put them right in the plugin, but there are at least 1000 of entity names. I had to do it with cfg.
farawayf is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-03-2019 , 12:23   Re: weird error
Reply With Quote #4

i think it's solved for now.
i forgot to put line loop in stock.
farawayf is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 05-03-2019 , 12:48   Re: weird error
Reply With Quote #5

Use parameters for custom functions, not global variables.

PHP Code:

stock bool CheckBEntity
(int caller, const char[] name)

    
char cname[64]; 
    
GetEntPropString(callerProp_Data"m_iName"cnamesizeof(cname)); 
     
    if (
StrEqual(cnamename)) { //error "array (s do no match" 
        
return true
    } 
    return 
false

__________________

Last edited by Ilusion9; 05-03-2019 at 12:49.
Ilusion9 is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 05-03-2019 , 13:11   Re: weird error
Reply With Quote #6

Quote:
Originally Posted by Ilusion9 View Post
Use parameters for custom functions, not global variables.

PHP Code:

stock bool CheckBEntity
(int caller, const char[] name)

    
char cname[64]; 
    
GetEntPropString(callerProp_Data"m_iName"cnamesizeof(cname)); 
     
    if (
StrEqual(cnamename)) { //error "array (s do no match" 
        
return true
    } 
    return 
false

check cfg inside of stock? it will not be a big load to check the cfg each time it is called ? or i misunderstood you
farawayf 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 02:20.


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