SetPlayerSkillLevel
Description:
Function SetPlayerSkillLevel set the skill level of a certain weapon type for a player.
Function SetPlayerSkillLevel was added in 0.3a and will not work in earlier versions! |
The skill parameter is NOT the weapon ID, it is the skill type. Click here for a list of skill types. |
Parameters:
(playerid, skill, level)
int | playerid | The ID of the player to set the weapon skill of. |
int | skill | The weapon to set the skill of. |
int | level | The skill level to set for that weapon, ranging from 0 to 999. A level out of range will max it out. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. This means the player specified does not exist.
Examples:
public OnPlayerSpawn(playerid) { SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1); // This will make the player use single-handed sawn-off shotguns. return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetPlayerArmedWeapon: Set a player's armed weapon.
- GivePlayerWeapon: Give a player a weapon.