AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please fix this: (https://forums.alliedmods.net/showthread.php?t=29660)

hip_hop_x 06-09-2006 22:10

Please fix this:
 
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.

Hawk552 06-09-2006 22:12

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.

NewUser 06-10-2006 01:05

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.");

Freecode 06-10-2006 01:11

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 :shock:

Hawk552 06-10-2006 08:40

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.

hip_hop_x 06-10-2006 10:05

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.

Hawk552 06-10-2006 10:06

It would help if you show us where the #if is to make sure you put the #endif at the right spot.

hip_hop_x 06-10-2006 10:25

I've put #endif at the end of public createINIFile. I haven't modified something else.

jtp10181 06-10-2006 10:36

he's just copying and pasting code and has no idea WTF he is doing.

hip_hop_x 06-10-2006 10:45

I know what i'm doing. I want to load the xp from a file.


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

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