Raised This Month: $ Target: $400
 0% 

Array crashing my server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 12-19-2011 , 10:26   Array crashing my server
Reply With Quote #1

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 ); }
Dr7sTyLe is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-19-2011 , 13:18   Re: Array crashing my server
Reply With Quote #2

PHP Code:
new iEndFile feofiFile );
while( !
iEndFile 
->
PHP Code:
while (!feof(iFile)) 
__________________
hleV is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-19-2011 , 14:00   Re: Array crashing my server
Reply With Quote #3

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.
__________________
fysiks 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 01:12.


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