ForcePlayerMap

From Multi Theft Auto: Wiki
Revision as of 11:55, 9 November 2024 by Fernando187 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is used to forcefully show a player's map (F11).

Syntax

Click to collapse [-]
Server
bool 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 [-]
Client
bool 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