AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Array crashing my server (https://forums.alliedmods.net/showthread.php?t=174363)

Dr7sTyLe 12-19-2011 10:26

Array crashing my server
 
My first time using arrays and the server is crashed when loading
Code:
#include < amxmodx > new Array:aArray; public plugin_cfg( ) {     aArray = ArrayCreate( 32 );     new iFile = fopen( "addons\maps.ini", "rt" );     new iEndFile = feof( iFile );     while( !iEndFile )     {         new szChar[ 256 ];         fgets( iFile, szChar, sizeof szChar - 1 );         ArrayPushString( aArray, szChar );     }     fclose( iFile ); } public plugin_init ( ) {     register_clcmd( "say 1", "msg" ); } public msg( ) {     new szLine[ 256 ];     ArrayGetString( aArray, 1, szLine, sizeof szLine - 1 );     client_print( 0, print_chat, "%s", szLine ); }

hleV 12-19-2011 13:18

Re: Array crashing my server
 
PHP Code:

new iEndFile feofiFile );
while( !
iEndFile 

->
PHP Code:

while (!feof(iFile)) 


fysiks 12-19-2011 14:00

Re: Array crashing my server
 
Just an FYI, addons/maps.ini does not normally exist and even if you make it you should not put it there as it, in itself, is not an addon.


All times are GMT -4. The time now is 12:05.

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