The Dink Network

Reply to Re: scripting trouble, why always me

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 9th 2006, 05:14 AM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
Ok. My DinkC Editor didn't find any errors, but it found some warnings. One of them is that &rock_placement wasn't declared in this script, so I assume that this is a global variable.
The second one, which is pretty serious, is that you should use "{" after an if statement.
From the DinkC Reference:

However, there is one critical error. This does not work for anything involving variables.

void talk(void)

{

int &temp = 0;

// This will not work!!

if (&life == &lifemax)

&temp = 1;

}

To properly assign variables in if statements, you must use the curly braces.

void talk(void)

{

int &temp = 0;

// This works fine.

if (&life == &lifemax)

{

&temp = 1;

}

}


I noticed that you used several times, expressions like this one:

if (&place >= 1000)
&place -= 1000;