ResendPlayerModInfo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(→‎Syntax: OOP syntax added)
 
(One intermediate revision by one other user not shown)
Line 8: 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 14: Line 14:
===Returns===
===Returns===
Returns ''true'' if the mod info will be resent, ''false'' otherwise.
Returns ''true'' if the mod info will be resent, ''false'' otherwise.
==Example==
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>


==Requirements==
==Requirements==

Latest revision as of 04:04, 15 July 2014

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
)

Requirements

Minimum server version 1.1.1-9.03451
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.1.1-9.03451" />

See Also

Shared