AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   problem with print in console maps list (https://forums.alliedmods.net/showthread.php?t=76611)

un7ouchab1e 08-27-2008 11:37

problem with print in console maps list
 
hi
i have a problem with
Code:

public pokazmapy(id)
{
    new
file = fopen("addons/amxmodx/configs/standardmaps.ini", "rt")
    new
text[256], textlen
   
if(file)
    {
        new
buffer[256]
        while(!
feof(file))
        {
           
fgets(file, buffer, 255)
            if(
buffer[0])
            {
               
textlen += format(text[textlen], 255-textlen, "%s", buffer)
            }
        }
    }
   
fclose(file)
   
client_print(id, print_console, "%s", text)
   
client_print(id, print_chat, "Otworz konsole aby zobaczyc liste dostepnych map w tym momencie")
    return
PLUGIN_HANDLED
}

show me the first 5 maps, with such a break

de_dust2

de_inferno

de_nuke

de_train

de_dust

etc... help someone?

Alka 08-27-2008 15:41

Re: problem with print in console maps list
 
After fgets(file, buffer, 255) put this line of code
Code:

trim(buffer);


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

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