پرش به مطلب اصلی

GetPlayerSkillLevel

هشدار

This function was added in omp v1.1.0.2612 and will not work in earlier versions!

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;
}

Notes

هشدار

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.