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

Multiple Game Names


Post New Thread Reply   
 
Thread Tools Display Modes
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-06-2018 , 13:08   Re: [ReAPI] Multiple Game Names
Reply With Quote #21

Use charsmax()
else: throw an error to logs
__________________
Relaxing is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-06-2018 , 13:34   Re: [ReAPI] Multiple Game Names
Reply With Quote #22

Quote:
Originally Posted by D3XT3R View Post
link?
his signature is a link
__________________
retired chump
DjSoftero is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-06-2018 , 14:42   Re: [ReAPI] Multiple Game Names
Reply With Quote #23

ther is a problem .... it wont read
Code:
#include <amxmodx>     new path[252]     get_configsdir(path, charsmax(path))         format(path, charsmax(path), "%s/Game_Names.ini", path)         if (file_exists(path))     {         new szData[33], szNames[32], iTextLength                 while (read_file(path, iLine, szData, charsmax(szData), iTextLength) != 0)         {             if (iLine > charsmax(g_szNames[]))                 break                         parse(szData, szNames, charsmax(szNames))                         if (szNames[0] == ';' || !szNames[0])             {                 iLine++                 continue             }                         g_szNames[iLine] = szNames                         iLine++         }     }
__________________

Last edited by D3XT3R; 01-13-2018 at 02:51.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-06-2018 , 14:53   Re: [ReAPI] Multiple Game Names
Reply With Quote #24

PHP Code:
if (iLine charsmax(g_szNames[]))
    break 
Wtf is this?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-06-2018 , 15:34   Re: [ReAPI] Multiple Game Names
Reply With Quote #25

check if more lines in the file as g_szNames[] can store
__________________

Last edited by D3XT3R; 01-13-2018 at 02:50.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Old 01-06-2018, 16:01
D3XT3R
This message has been deleted by D3XT3R.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-07-2018 , 05:41   Re: [ReAPI] Multiple Game Names
Reply With Quote #26

Use copy....
__________________
HamletEagle is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-07-2018 , 06:41   Re: [ReAPI] Multiple Game Names
Reply With Quote #27

Quote:
Originally Posted by HamletEagle View Post
Use copy....
okay i will try
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-12-2018 , 16:38   Re: [ReAPI] Multiple Game Names
Reply With Quote #28

Updated, added config fille to make easy add names
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-23-2018 , 22:03   Re: [ReAPI] Multiple Game Names
Reply With Quote #29

i tried to compile with amx 1.8.3 - amx 1.8.2 and with reamx 1.8.3 locally, and no sucess!

tarsisd2 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 01-24-2018 , 12:32   Re: [ReAPI] Multiple Game Names
Reply With Quote #30

i change some code to compile, now i get no errors

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <reapi>

new g_szGnames[64][32]
new 
iNameLengthiLine

static const PLUGIN_NAME[]     = "Multiple Game Names"
static const PLUGIN_AUTHOR[]     = "mforce & DeXTeR"
static const PLUGIN_VERSION[]    = "1.1"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);    // & ReHLDS Team
    
register_cvar("MultiGameNames"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
    
    
set_task(1.0"re_gamename", .flags="b");
    
re_read()
}

public 
re_gamename()
{
    
set_member_game(m_GameDescg_szGnames[iLine++ % iNameLength]);
}

public 
re_read()
{
    new 
path[32]
    
get_configsdir(pathcharsmax(path))
    
    
format(pathcharsmax(path), "%s/Game_Names.ini"path)
    
    if (
file_exists(path))
    {
        new 
szData[33], szGnames[32]
        
        while (
read_file(pathiLineszDatacharsmax(szData), iNameLength) != 0)
        {
            if (
iLine charsmax(g_szGnames[]))
                break
            
            
parse(szDataszGnamescharsmax(szGnames))
            
            if (
szGnames[0] == ';' || !szGnames[0])
            {
                continue
            }
            
g_szGnames[iLine] = szGnames
            
            iLine
++
        }
    }

or change
PHP Code:
    register_cvar("MultiGameNames"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED
to

PHP Code:
    register_cvar("MultiGameNames""1.1"FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED
since you don't have PLUGIN_VERSION registered anywhere

Last edited by tarsisd2; 01-24-2018 at 12:39. Reason: update
tarsisd2 is offline
Reply


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 03:31.


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