---
title: "SetPlayerVirtualWorld | open.mp"
description: "Set the virtual world of a player."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/SetPlayerVirtualWorld
language: th
---

# SetPlayerVirtualWorld

## คำอธิบาย

Set the virtual world of a player. They can only see other players or vehicles that are in that same world.

| Name | Description |
| --- | --- |
| playerid | The ID of the player you want to set the virtual world of. |
| worldid | The virtual world ID to put the player in. |

## ส่งคืน

1: The function executed successfully.

0: The function failed to execute. This means the player is not connected.

## ตัวอย่าง

```c
if (strcmp(cmdtext, "/world3", true) == 0)
{
    SetPlayerVirtualWorld(playerid, 3);
    return 1;
}
```

## บันทึก

หมายเหตุ

The default virtual world is 0.

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   GetPlayerVirtualWorld: Check what virtual world a player is in.
-   SetVehicleVirtualWorld: Set the virtual world of a vehicle.
