跳至主要内容

SetModeRestartTime

注意

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

Description

Sets the delay between loading main scripts, in seconds.

Parameters

NameDescription
Float:secondsSeconds to restart.

Return Values

1 - Function executed successfully.

0 - Function failed to execute. This means that the specified seconds should not be less than 1.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/restart", true))
{
if (!IsPlayerAdmin(playerid))
{
return 1;
}

SetModeRestartTime(5.0);
SendClientMessage(playerid, -1, "[SERVER]: The server will restart in 5 seconds.");
return 1;
}
return 0;
}

Notes

注意

The seconds parameter is a float.