ResendPlayerModInfo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}
{{Server function}}
{{New feature|3.0120|1.2|
'''Available only in MTA SA 1.1.1-9.03451 and onwards'''
}}


This function will force the specified player to resend their mod info, triggering the [[onPlayerModInfo]] event again.
This function will force the specified player to resend their mod info, triggering the [[onPlayerModInfo]] event again.
Line 11: Line 8:
bool resendPlayerModInfo ( player thePlayer )
bool resendPlayerModInfo ( player thePlayer )
</syntaxhighlight>
</syntaxhighlight>
 
{{OOP||[[player]]:resendModInfo||}}
===Required Arguments===
===Required Arguments===
*'''thePlayer''': A [[player]] object referencing the specified player
*'''thePlayer''': A [[player]] object referencing the specified player
Line 18: Line 15:
Returns ''true'' if the mod info will be resent, ''false'' otherwise.
Returns ''true'' if the mod info will be resent, ''false'' otherwise.


==Requirements==
==Example==  
{{Requirements|1.1.1-9.03451|n/a|}}
This example shows how to resend each players mod info during [[onResourceStart]]
<syntaxhighlight lang="lua">
addEventHandler( "onResourceStart", resourceRoot,
    function()
        for _,player in ipairs( getElementsByType("player") ) do
            resendPlayerModInfo( player )
        end
    end
)
</syntaxhighlight>


==See Also==
==See Also==
{{Player functions}}
{{Player functions|server}}

Latest revision as of 15:36, 7 November 2024

This function will force the specified player to resend their mod info, triggering the onPlayerModInfo event again.

Syntax

bool resendPlayerModInfo ( player thePlayer )

OOP Syntax Help! I don't understand this!

Method: player:resendModInfo(...)


Required Arguments

  • thePlayer: A player object referencing the specified player

Returns

Returns true if the mod info will be resent, false otherwise.

Example

This example shows how to resend each players mod info during onResourceStart

addEventHandler( "onResourceStart", resourceRoot,
    function()
        for _,player in ipairs( getElementsByType("player") ) do
            resendPlayerModInfo( player )
        end
    end
)

See Also