Weapon Skill System [ REP + ]
#6

Its easy if you use this include(it already have this function: GetPlayerSkillLevel(playerid, skill);)
Download "playerfuncs.inc" (link: https://sampforum.blast.hk/showthread.php?tid=573961).

So you can increase the player skill level on every kill with getting the old skill level +
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new skill = 0;
        switch(GetPlayerWeapon(killerid))
        {
            case 22: skill = WEAPONSKILL_PISTOL;
            case 23: skill = WEAPONSKILL_PISTOL_SILENCED;
            //... add all other types you want
        }
        SetPlayerSkillLevel(killerid, skill, GetPlayerSkillLevel(killerid, skill) + 10);
    }
    return 1;
}
For command part, if you are using zcmd:
pawn Код:
CMD:weaponskills(playerid)
{
    new string[144];
    format(string, sizeof(string) "Pistol: %i/1000", GetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL));//this is for pistol, it will show the pistol skills in client message form
    SendClientMessage(playerid, -1, string);
    //...add more if you want
    return 1;
}
Reply


Messages In This Thread
Weapon Skill System [ REP + ] - by _GHT_MarK445 - 13.05.2015, 20:25
Re: Weapon Skill System [ REP + ] - by _GHT_MarK445 - 14.05.2015, 08:28
Re: Weapon Skill System [ REP + ] - by Youssef221 - 14.05.2015, 08:51
Re: Weapon Skill System [ REP + ] - by bigtigerbeee - 14.05.2015, 09:01
Re: Weapon Skill System [ REP + ] - by AnnaSB - 14.05.2015, 09:17
Re: Weapon Skill System [ REP + ] - by Gammix - 14.05.2015, 09:21
Re: Weapon Skill System [ REP + ] - by SoFahim - 14.05.2015, 13:10

Forum Jump:


Users browsing this thread: 2 Guest(s)