SY_Notify
V 2.2
CREATE TABLE IF NOT EXISTS ` sy_notify ` (
` identifier ` varchar ( 65 ) DEFAULT NULL ,
` position ` longtext DEFAULT NULL ,
UNIQUE KEY ` identifier ` ( ` identifier ` ) USING HASH
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
ensure SY_Notify
要显示通知,您应该像下面这样调用它:
exports [ ' SY_Notify ' ]: Alert ( " Title " , " Message " , Time , ' type ' )
TriggerClientEvent ( ' SY_Notify:Alert ' , source , " Title " , " Message " , Time , ' type ' )
要设置通知显示时间,请使用:
[1 second]
[2 seconds]
[5 seconds]
[10 seconds]
要更改通知类型,请使用以下类型的通知:
如果您需要将此通知添加为 ESX 旧版中的默认通知,请在 @es_extended/client/function.lua 中添加给定代码
function ESX . ShowNotification ( message , type , length )
if GetResourceState ( " esx_notify " ) ~= " missing " then
exports [ " esx_notify " ]: Notify ( type , length , message )
else
print ( " [^1ERROR^7] ^5ESX Notify^7 is Missing! " )
end
end
替换为
function ESX . ShowNotification ( message , type , length )
if GetResourceState ( " SY_Notify " ) ~= " missing " then
exports [ ' SY_Notify ' ]: Alert ( " NOTIFICATION " , message , length , type )
else
print ( " [^1ERROR^7] ^5SY_NOTIFY^7 is Missing! " )
end
end