CreateObject函数
From SA-MP Wiki
Description:
创造一个物件.
(物件ID, X坐标, Y坐标, Z坐标, X轴旋转度数, Y轴旋转度数, Z轴旋转度数, 可被发现的距离)
物件ID | The model 你想创建的物件所属的ID. |
X坐标 | 需要创建物件位置的X坐标. |
Y坐标 | 需要创建物件位置的Y坐标. |
Z坐标 | 需要创建物件位置的Z坐标. |
X轴旋转度数 | 物件X轴需要旋转的度数. |
Y轴旋转度数 | 物件Y轴需要旋转的度数. |
Z轴旋转度数 | 物件Z轴需要旋转的度数. |
可被发现的距离 | (注意) 玩家们可以看见他们的最远距离. 0.0 会被设置成系统默认距离.300.0是距离的最大单位. 本指令在服务端版本0.3b时开始生效. |
返回 | 指定ID的OBJ物件生成. |
public OnGameModeInit() { CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); //物件被玩家发现的距离值为系统默认值. CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0, 250.0); //物件被玩家发现的距离值为250个单位. CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0, 50000.0); //物件被玩家发现的距离值为300个单位. (极限值) return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- DestroyObject: Destroy an object.
- IsValidObject: Checks if a certain object is vaild.
- MoveObject: Move an object.
- StopObject: Stop an object from moving.
- SetObjectPos: Set the position of an object.
- SetObjectRot: Set the rotation of an object.
- GetObjectPos: Locate an object.
- GetObjectRot: Check the rotation of an object.
- AttachObjectToPlayer: Attach an object to a player.
- CreatePlayerObject: Create an object for only one player.
- DestroyPlayerObject: Destroy a player object.
- IsValidPlayerObject: Checks if a certain player object is vaild.
- MovePlayerObject: Move a player object.
- StopPlayerObject: Stop a player object from moving.
- SetPlayerObjectPos: Set the position of a player object.
- SetPlayerObjectRot: Set the rotation of a player object.
- GetPlayerObjectPos: Locate a player object.
- GetPlayerObjectRot: Check the rotation of a player object.
- AttachPlayerObjectToPlayer: Attach a player object to a player.