SetWeather
描述
为所有玩家设置全局天气效果。
参数名 | 说明 |
---|---|
weatherid | 要设置的天气 ID |
返回值
本函数没有特定返回值。
示例代码
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/sandstorm", true)) // 检测沙尘暴指令
{
SetWeather(19); // 设置19号沙尘暴天气
return 1;
}
return 1;
}
注意事项
提示
- 启用TogglePlayerClock后天气会渐变切换,而非立即生效
- 游戏仅支持 0-20 共 21 种天气 ID,但未做范围校验
相关函数
- GetWeather: 获取当前全局天气
- SetPlayerWeather: 设置玩家独立天气
- SetGravity: 设置全局重力参数