GetPlayerStat

From Multi Theft Auto: Wiki
Revision as of 00:11, 9 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

This function returns a float that contains the value of the specified statistic, for a specific player.

Syntax

float getPlayerStat ( player player, stat )

Required Arguments

  • player: The player whose stat you want to retrieve.
  • stat: A whole number determining the stat ID.

Returns

Returns a float indicating the statistic value.

Example

This example outputs a players stat.

function onPlayerSpawn ( player )
  stat = getPlayerStat ( player, 102 )
  -- Check that getPlayerStat returned a value
  if ( stat ) then
	-- Output the stat in the chat text
    outputChatBox ( "The player's stat for 102 is: " .. stat )
end

See Also