Skip to content

Commit

Permalink
Missing syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Less authored Nov 6, 2023
1 parent aa58f6f commit 8c44628
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ We start with the macro, which almost always has the same pattern. Bear in mind

To make a timer we need two things - a timer function and a way to call the timer function. The former is just a public function, the latter is some code that must be run when the mode starts. There are many ways to get code to run at mode start, but the simplest is actually another annotation - `@init()`. So we write a function with an `@init()` annotation to start the timer, and a second function with a normal `public` declaration as the code itself. Note that because of the way `@init()` works we can actually give these two functions the same name, but that isn't always the case. In short, we want the code above to become:

```
```pawn
forward OneSecond();
@init() OneSecond()
Expand All @@ -304,7 +304,7 @@ public OneSecond()

To use the `.interval` syntax with this structure we can create a helper function that takes all the same parameters as we want to make available to users of the annotation, with all the correct names, and do everything in there instead:

```
```pawn
@task__(const func__[], interval = 1000, bool:repeat = true, copies = 1)
{
while (copies--)
Expand Down

0 comments on commit 8c44628

Please sign in to comment.