SetPlayerSkillLevel
From SA-MP Wiki
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.
(playerid, skill, level)
| playerid | The ID of the player to set the weapon skill of. |
| skill | The weapon type you want to set the skill of. |
| level | The 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.
- GivePlayerWeapon: Give a player a weapon.
- SetPlayerWantedLevel: Set a player's wanted level.
- SetPlayerDrunkLevel: Set a player's drunk level.
