ForcePlayerMap: Difference between revisions
Jump to navigation
Jump to search
(add client syntax) |
Fernando187 (talk | contribs) No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | {{Server client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function is used to forcefully show a player's | This function is used to forcefully show a player's map (F11). | ||
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePlayer''': A [[player]] object referencing the specified player | *'''thePlayer''': A [[player]] object referencing the specified player | ||
*'''forceOn''': A boolean value representing whether or not the | *'''forceOn''': A boolean value representing whether or not the player's map will be forced on | ||
</section> | </section> | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
Line 15: | Line 15: | ||
{{OOP||[[Player]].forceMap||isPlayerMapForced}} | {{OOP||[[Player]].forceMap||isPlayerMapForced}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''forceOn''': A boolean value representing whether or not the | *'''forceOn''': A boolean value representing whether or not the player's map will be forced on | ||
</section> | </section> | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the player's | Returns ''true'' if the player's map was forced on, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example forces the | This example forces the map to show for the player named "dave" on for 10 seconds, if it hasn't been already. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Get the player named "dave" | -- Get the player named "dave" | ||
Line 27: | Line 27: | ||
-- Make sure we found him | -- Make sure we found him | ||
if ( dave ) then | if ( dave ) then | ||
if not isPlayerMapForced ( dave ) then -- if his | if not isPlayerMapForced ( dave ) then -- if his map isn't already forced on | ||
forcePlayerMap ( dave, true ) -- force it on | forcePlayerMap ( dave, true ) -- force it on | ||
setTimer ( forcePlayerMap, 10000, 1, dave, false ) -- stop forcing in 10 seconds | setTimer ( forcePlayerMap, 10000, 1, dave, false ) -- stop forcing in 10 seconds | ||
Line 38: | Line 38: | ||
[[ru:forcePlayerMap]] | [[ru:forcePlayerMap]] | ||
[[pt-br:forcePlayerMap]] |
Latest revision as of 11:55, 9 November 2024
This function is used to forcefully show a player's map (F11).
Syntax
Click to collapse [-]
Serverbool forcePlayerMap ( player thePlayer, bool forceOn )
OOP Syntax Help! I don't understand this!
- Method: player:forceMap(...)
- Variable: .mapForced
- Counterpart: isPlayerMapForced
Required Arguments
- thePlayer: A player object referencing the specified player
- forceOn: A boolean value representing whether or not the player's map will be forced on
Click to collapse [-]
Clientbool forcePlayerMap ( bool forceOn )
OOP Syntax Help! I don't understand this!
- Method: Player.forceMap(...)
- Counterpart: isPlayerMapForced
Required Arguments
- forceOn: A boolean value representing whether or not the player's map will be forced on
Returns
Returns true if the player's map was forced on, false otherwise.
Example
This example forces the map to show for the player named "dave" on for 10 seconds, if it hasn't been already.
-- Get the player named "dave" dave = getPlayerFromName ( "dave" ) -- Make sure we found him if ( dave ) then if not isPlayerMapForced ( dave ) then -- if his map isn't already forced on forcePlayerMap ( dave, true ) -- force it on setTimer ( forcePlayerMap, 10000, 1, dave, false ) -- stop forcing in 10 seconds end end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState