ForcePlayerMap: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
m (→Example update) |
||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
This example forces the radar map of the player named " | This example forces the radar map of the player named "Pedro" on for 10 seconds, if it hasn't been already | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Get the player named "Pedro" | -- Get the player named "Pedro" | ||
Pedro = getPlayerFromName ( "Pedro" ) | |||
-- | -- Pedro sure we found him | ||
if ( | if ( Pedro ) then | ||
if not isPlayerMapForced ( | if not isPlayerMapForced ( Pedro ) then -- if his radar map isn't already forced on | ||
forcePlayerMap ( | forcePlayerMap ( Pedro, true ) -- force it on | ||
setTimer ( forcePlayerMap, 10000, 1, | setTimer ( forcePlayerMap, 10000, 1, Pedro, false ) -- stop forcing in 10 seconds | ||
end | end | ||
end | end |
Revision as of 11:19, 23 July 2010
This function is used to forcefully show a player's radar map.
Syntax
bool forcePlayerMap ( player thePlayer, bool forceOn )
Required Arguments
- thePlayer: A player object referencing the specified player
- forceOn: A boolean value representing whether or not the players radar map will be forced on
Returns
Returns true if the player's radar map was forced on, false otherwise.
Example
Click to collapse [-]
ServerThis example forces the radar map of the player named "Pedro" on for 10 seconds, if it hasn't been already
-- Get the player named "Pedro" Pedro = getPlayerFromName ( "Pedro" ) -- Pedro sure we found him if ( Pedro ) then if not isPlayerMapForced ( Pedro ) then -- if his radar map isn't already forced on forcePlayerMap ( Pedro, true ) -- force it on setTimer ( forcePlayerMap, 10000, 1, Pedro, 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