# give_money

Commands the bot to send money (L$) to a specific avatar.

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("give_money", [
  "avatar", "cd93067e-7c4e-41c0-ba91-be01f4bafe35",
  "amount", 10,
  "comment", "API testing routine"
]);
```

```snippet http-api-variables-OmJyUigTgO
```

```snippet http-api-input-basic-parameters-5FcVlaJbq0 action="give_money"
```

```snippet http-api-input-q5yvAagqsZ
avatar  | yes      | The UUID of the avatar to receive the payment
amount  | yes      | The amount of L$ to send
comment | optional | A text comment for the money transaction
```

```snippet http-api-output-JAwUcmg7i7
```

# Error messages

The bot returns either:

```
result=OK
```

on success, or:

```
result=FAIL
resulttext=text-string
```

to indicate a problem (commonly due to low bot balance).

# Example

The following example sends **L$10** to **Glaznah Gassner** in-world:

```csharp
string params = llDumpList2String([
  "action="  + "give_money",
  "apikey="  + llEscapeURL(sbApiKey),
  "botname=" + llEscapeURL(sbBotName),
  "secret="  + llEscapeURL(sbBotApiToken),
  "avatar="  + "cd93067e-7c4e-41c0-ba91-be01f4bafe35",
  "amount=" + "10",
  "comment=" + llEscapeURL("API testing routine")
], "&");

llHTTPRequest("https://api.mysmartbots.com/api/bot.html",
  [HTTP_METHOD, "POST"], params);
```