ForcePlayerMap: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 24093 by Chumillas (Talk))
(Undo revision 24088 by Chumillas (Talk))
Line 14: Line 14:


==Example==
==Example==
<section name="Server" class="server" show="true">
This example forces the radar map of 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 "Pedro"
-- Get the player named "dave"
dave = getPlayerFromName ( "Pedro" )
dave = getPlayerFromName ( "dave" )
-- Make sure we found him
-- Make sure we found him
if ( dave ) then
if ( dave ) then
Line 27: Line 26:
end
end
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}

Revision as of 11:48, 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

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