ForcePlayerMap: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Section using)
No edit summary
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Server function}}
{{Server client function}}
__NOTOC__
__NOTOC__
This function is used to forcefully show a player's radar map.
This function is used to forcefully show a player's radar map.


==Syntax==
==Syntax==
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">bool forcePlayerMap ( player thePlayer, bool forceOn )</syntaxhighlight>
<syntaxhighlight lang="lua">bool forcePlayerMap ( player thePlayer, bool forceOn )</syntaxhighlight>
 
{{OOP||[[player]]:forceMap|mapForced|isPlayerMapForced}}
===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 players radar map will be forced on
*'''forceOn''': A boolean value representing whether or not the players radar map will be forced on
 
</section>
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">bool forcePlayerMap ( bool forceOn )</syntaxhighlight>
{{OOP||[[Player]].forceMap||isPlayerMapForced}}
===Required Arguments===
*'''forceOn''': A boolean value representing whether or not the players radar map will be forced on
</section>
===Returns===
===Returns===
Returns ''true'' if the player's radar map was forced on, ''false'' otherwise.
Returns ''true'' if the player's radar map was forced on, ''false'' otherwise.


==Example==
==Example==
<section show="true" name="Server" class="server">
This example forces the radar map to show for the player named "dave" on for 10 seconds, if it hasn't been already.
This example forces the radar map of 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 33:
end
end
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}
[[ru:forcePlayerMap]]
[[pt-br:forcePlayerMap]]

Latest revision as of 23:49, 27 September 2017

This function is used to forcefully show a player's radar map.

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 players radar 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 players radar map will be forced on

Returns

Returns true if the player's radar map was forced on, false otherwise.

Example

This example forces the radar 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 radar 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