SetPlayerSkillLevel

From SA-MP Wiki

Jump to: navigation, search


SetPlayerSkillLevel was added in SA-MP 0.3a This function was added in SA-MP 0.3a and will not work in earlier versions!


Set the skill level of a certain weapon type for a player.


Parameters:
(playerid, skill, level)
playeridThe ID of the player to set the weapon skill of.
skillThe weapon type you want to set the skill of.
levelThe skill level to set for that weapon, ranging from 0 to 999. (A level out of range will max it out)


ReturnsThis function doesn't return a specific value


Image:32px-Circle-style-warning.png Important Note: The skill parameter is NOT the weapon ID, it is the skill type. Click here for a list of skill types.


public OnPlayerSpawn(playerid)
{
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
    //This will make them use single-handed sawnoff shotguns.
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools