Player::notify: Difference between revisions
No edit summary |
MrPancakers (talk | contribs) m (Cleaned up page, added example.) |
||
| Line 1: | Line 1: | ||
This function sends notification | __NOTOC__ | ||
This function sends a notification to the player. | |||
'''Codes:''' | '''Codes:''' | ||
~n~ New line | *'''~n~''' New line | ||
*'''~r~''' Red | |||
*'''~g~''' Green | |||
*'''~b~''' Blue | |||
*'''~w~''' or ~s~ White | |||
*'''~y~''' Yellow | |||
*'''~p~''' Purple | |||
*'''~l~''' Black (lower case L) | |||
== Syntax == | |||
<pre> | |||
player.notify(message) | |||
</pre> | |||
=== Parameters === | |||
*'''message''' - {{RageType|String}} | |||
== | |||
== Example == | == Example == | ||
Creates a command to let the player enter a message which will then come up as a notification. | |||
< | <div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;"> | ||
player.notify( | <div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div> | ||
</ | <pre> | ||
mp.events.addCommand('notify', (player, message) => { | |||
if(!message) return player.outputChatBox("You need to enter a message."); | |||
player.notify(message); | |||
}); | |||
</pre> | |||
</div> | |||
==See Also== | ==See Also== | ||
{{Player_block}} | {{Player_block}} | ||
Revision as of 12:38, 29 September 2018
This function sends a notification to the player.
Codes:
- ~n~ New line
- ~r~ Red
- ~g~ Green
- ~b~ Blue
- ~w~ or ~s~ White
- ~y~ Yellow
- ~p~ Purple
- ~l~ Black (lower case L)
Syntax
player.notify(message)
Parameters
- message - String
Example
Creates a command to let the player enter a message which will then come up as a notification.
Server-Side
mp.events.addCommand('notify', (player, message) => {
if(!message) return player.outputChatBox("You need to enter a message.");
player.notify(message);
});
See Also
- Functions
- Player::ban
- Player::call
- Player::callProc
- Player::callToStreamed
- Player::callUnreliable
- Player::cancelPendingRpc
- Player::clearDecorations
- Player::getClothes
- Player::getDecoration
- Player::getFaceFeature
- Player::getHeadBlend
- Player::getHeadOverlay
- Player::getProp
- Player::getWeaponAmmo
- Player::giveWeapon
- Player::hasPendingRpc
- Player::invoke
- Player::isStreamed
- Player::isStreamedFor
- Player::kick
- Player::kickSilent
- Player::notify
- Player::outputChatBox
- Player::playAnimation
- Player::playScenario
- Player::putIntoVehicle
- Player::removeFromVehicle
- Player::removeObject
- Player::removeWeapon
- Player::removeAllWeapons
- Player::resetWeapon
- Player::setClothes
- Player::setCustomization
- Player::setDecoration
- Player::setFaceFeature
- Player::setHairColor
- Player::setHeadBlend
- Player::setHeadOverlay
- Player::setProp
- Player::setWeaponAmmo
- Player::spawn
- Player::stopAnimation
- Player::updateHeadBlend
- Player::enableVoiceTo
- Player::disableVoiceTo
- Weapons::clear
- Entity::destroy
- Entity::dist
- Entity::distSquared
- Entity::getVariable
- Entity::setVariable
- Entity::setVariables
- Properties
- Player::action
- Player::aimTarget
- Player::allWeapons
- Player::armour
- Player::eyeColor
- Player::faceFeatures
- Player::hairColor
- Player::hairHighlightColor
- Player::heading
- Player::health
- Player::rgscId
- Player::ip
- Player::serial
- Player::isAiming
- Player::isClimbing
- Player::isEnteringVehicle
- Player::isInCover
- Player::isInMelee
- Player::isJumping
- Player::isLeavingVehicle
- Player::isOnLadder
- Player::isReloading
- Player::name
- Player::packetLoss
- Player::ping
- Player::seat
- Player::socialClub
- Player::streamedPlayers
- Player::vehicle
- Player::voiceListeners
- Player::disableOutgoingSync
- Player::weapon
- Player::weaponAmmo
- Player::weapons
- Entity::alpha
- Entity::data
- Entity::dimension
- Entity::id
- Entity::model
- Entity::position
- Entity::type