Raised This Month: $ Target: $400
 0% 

Please fix this:


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-09-2006 , 22:10   Please fix this:
Reply With Quote #1

Code:
public createINIFile()       {     if ( file_exists(gXpfile) ) delete_file(gXpfile)         // code found in superhero mod     write_file(gXpfile,"*** NUMLEVELS  - The total number of levels  ***",0)     write_file(gXpfile,"*** LTXPLEVELS - evolution lvl config  ex: 0/50 ***",1)     write_file(gXpfile,"*** LTXPGIVEN  - the xp ex: 2/50", 2)         // the file     write_file(gXpfile,"NUMLEVELS 10" , 4)     write_file(gXpfile,"LTXPLEVELS 0 50 200 400 800 1600 3200 6400 12800 25600 51200", 5)     write_file(gXpfile,"LTXPGIVEN  6 8 10 12 14 16 20 24 28 32 40", 6) }

The error:

Error: Expected token: "#endif", but found "-end of file-"
Need help to fix this.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-09-2006 , 22:12  
Reply With Quote #2

You used an #if <something> without ending it with an #endif

This is roughly equivalent to doing this:

Code:
if(integer == 5) {

Without the ending bracket.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
NewUser
Member
Join Date: Mar 2006
Location: over there
Old 06-10-2006 , 01:05  
Reply With Quote #3

Quote:
Originally Posted by Hawk552
You used an #if <something> without ending it with an #endif

This is roughly equivalent to doing this:

Code:
if(integer == 5) {

Without the ending bracket.
I didn't see an opening bracket for the if statement either.

Code:
if ( file_exists(gXpfile) ) delete_file(gXpfile)
Correct me if I'm wrong, but don't if statements need opening and closing brackets? Unless it's something simple like:
Code:
if(gaben[id]) client_print(id,print_chat, "[Gaben] gaben will eat you.");
__________________
LEWL.
NewUser is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 06-10-2006 , 01:11  
Reply With Quote #4

Code:
if ( file_exists(gXpfile) ) delete_file(gXpfile)         // code found in superhero mod     write_file(gXpfile,"*** NUMLEVELS  - The total number of levels  ***",0)
dont make no sense to me if u delete the file and then write into it
Freecode is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-10-2006 , 08:40  
Reply With Quote #5

He's still messing an #endif.

Quote:
Originally Posted by NewUser
Quote:
Originally Posted by Hawk552
You used an #if <something> without ending it with an #endif

This is roughly equivalent to doing this:

Code:
if(integer == 5) {

Without the ending bracket.
I didn't see an opening bracket for the if statement either.

Code:
if ( file_exists(gXpfile) ) delete_file(gXpfile)
Correct me if I'm wrong, but don't if statements need opening and closing brackets? Unless it's something simple like:
Code:
if(gaben[id]) client_print(id,print_chat, "[Gaben] gaben will eat you.");
No, I don't mean like that. I mean

Code:
#if

As in
Code:
#if

Not

Code:
if(something) {

Just
Code:
#if

EDIT: Freecode, he's trying to make a fresh file.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-10-2006 , 10:05  
Reply With Quote #6

I've just added #endif at the end of code
Code:
public createINIFile()       {     if( file_exists(gXpfile) ) delete_file(gXpfile)         // code found in superhero mod     write_file(gXpfile,"*** NUMLEVELS  - The total number of levels  ***",0)     write_file(gXpfile,"*** LTXPLEVELS - evolution lvl config  ex: 0/50 ***",1)     write_file(gXpfile,"*** LTXPGIVEN  - the xp ex: 2/50", 2)         // the file     write_file(gXpfile,"NUMLEVELS 10" , 4)     write_file(gXpfile,"LTXPLEVELS 0 50 200 400 800 1600 3200 6400 12800 25600 51200", 5)     write_file(gXpfile,"LTXPGIVEN  6 8 10 12 14 16 20 24 28 32 40", 6)     #endif         }


And worked. I still need help with my mod. If someone whant's to join the xu mod please pm me.


Thx for your help guys.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-10-2006 , 10:06  
Reply With Quote #7

It would help if you show us where the #if is to make sure you put the #endif at the right spot.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-10-2006 , 10:25  
Reply With Quote #8

I've put #endif at the end of public createINIFile. I haven't modified something else.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-10-2006 , 10:36  
Reply With Quote #9

he's just copying and pasting code and has no idea WTF he is doing.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-10-2006 , 10:45  
Reply With Quote #10

I know what i'm doing. I want to load the xp from a file.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
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 08:05.


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