跳到主要内容

AttachPlayerObjectToVehicle

描述

将玩家物体附加到车辆上。

名称说明
playerid创建该物体的所属玩家 ID
objectid要附加的玩家物体 ID
parentid目标车辆 ID
Float:offsetXX 轴位置偏移量
Float:offsetYY 轴位置偏移量
Float:offsetZZ 轴位置偏移量
Float:rotationXX 轴旋转偏移量
Float:rotationYY 轴旋转偏移量
Float:rotationZZ 轴旋转偏移量

返回值

本函数没有特定返回值。

示例

public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate)
{
if (newstate == PLAYER_STATE_DRIVER) // 玩家进入车辆时
{
// 附加巨型奶牛模型
new cowObject = CreatePlayerObject(playerid, 16442, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
new vehicleid = GetPlayerVehicleID(playerid);

AttachPlayerObjectToVehicle(playerid, cowObject, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
}
return 1;
}

注意事项

提示

在附加操作前必须创建物体

相关函数