AddPlayerChatRange: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | <syntaxhighlight lang="Lua> | ||
AddCommand("whisper", function(playerid, ...) | |||
local message = table.concat({...}, " ") | |||
if #message < 10 or #message > 128 then | |||
return AddPlayerChat(playerid, "Invalid specified range of the message.") | |||
end | |||
local x, y, z = GetPlayerLocation(playerid) | |||
AddPlayerChatRange(x, y, 50.0, "[WHISPER] "..GetPlayerName(playerid)..": "message) | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 15:12, 17 November 2019
Description
Add (or send) a chat message to everyone in the specified range.
Syntax
AddPlayerChatRange(x, y, range, message)
Parameters
- x
The X axis - y
The Y axis - range
The Z axis - message
The text message to send.
Return Value
- __EDIT_ME__
Example
AddCommand("whisper", function(playerid, ...)
local message = table.concat({...}, " ")
if #message < 10 or #message > 128 then
return AddPlayerChat(playerid, "Invalid specified range of the message.")
end
local x, y, z = GetPlayerLocation(playerid)
AddPlayerChatRange(x, y, 50.0, "[WHISPER] "..GetPlayerName(playerid)..": "message)
end)