跳到主要內容

GetPlayerSkillLevel

注意

此函式於 omp v1.1.0.2612 版本中新增,在更早的版本中無法使用!

Description​

Get the player skill level of a certain weapon type.

NameDescription
playeridThe ID of the player.
WEAPONSKILL:skillThe weapon to get the skill of.

Returns​

0 - failure (invalid weapon skill).

Otherwise, it returns the skill level of the weapon type.

Examples​

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/skill", true))
{
new string[64];

new skill = GetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL);

format(string, sizeof(string), "Your pistol skill level is %d", skill);
SendClientMessage(playerid, 0xFFFF00FF, string);
return 1;
}
return 0;
}

Good to know​

注意

The skill parameter is NOT the weapon ID, it is the skill type. Click here for a list of skill types.

Related Functions

Related Information

  • Weapon Skills: List of weapon skills that are used to set player's skill level.