> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/start-here/first-mistakes-to-recognize.md).

# First mistakes to recognize

### Declaring inside a block

```cpp
main {
    int value;  // invalid: runtime variables must be top-level
}
```

Move `int value;` above `init` / `main`.

***

### Confusing assignment and comparison

```cpp
if(mode = 2) { }   // assigns 2; the condition is then true
if(mode == 2) { }  // compares; usually what was intended
```

Zen Studio Live warns about assignment in a condition, but write the intended operator.

***

### Using the wrong letter case

`PS5_CROSS`, `ps5_cross`, and `PS5_Cross` are different names. Only the defined constant is valid.

***

### Assuming a function changes its caller's variable

Function arguments are values held in local parameters:

```cpp
int amount = 10;

main {
    amount = add_five(amount);  // store the returned value
}

function add_five(value) {
    value = value + 5;
    return value;
}
```

***

### Writing forever in an inner loop

```cpp
while(TRUE) { }  // do not do this in live real-time code
```

`main` is already the repeating loop. Inner loops should complete quickly and have an obvious bound.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/start-here/first-mistakes-to-recognize.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
