ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getPedStat

Function

getPedStat

Server and clientPedsIdentical to MTA:SA

Returns a San Andreas stat value for a ped, e.g. weapon skill, stamina, muscle or driving skill. Stats range from 0 to 1000 and affect gameplay (e.g. 69-79 are weapon skills; at 999 a ped dual-wields pistols). On the client, for your own ped the value is read from the game, for others from the server.

Syntax

float getPedStat(ped ped, int stat)

Arguments

pedped
A player or an NPC.
statint
Stat number 0-342, e.g. 22 stamina, 23 muscle, 24 max health, 69 pistol skill, 160 driving, 229 motorbike, 230 cycling.

Returns

Value 0-1000 (0 when not set).

Example

addCommandHandler("staty", function(player)
    outputChatBox("Pistolet: " .. getPedStat(player, 69) .. ", jazda: " .. getPedStat(player, 160), player)
end)

See also