SetPlayerSkillLevel

From SA-MP Wiki

Jump to: navigation, search

SetPlayerSkillLevel


Warning: This function was added in SA-MP version 0.3. It is not available in previous 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)


This function does not return a specific value.


Important Note: The skill parameter is NOT the weaponid, it is the weapon type. Click here for a list of weapon 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 might be useful as well, as they're related to this function in one way or another.

Personal tools