• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [HELP] Weapon Skill Command
#2
Code:
stock WeapSkill_Poor(playerid)
{
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1);
    return 1;
}

COMMAND:poor(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Devi loggare come RCON.");
    {
        for(new i=0; i<MAX_PLAYERS; i)
        {
            if(!IsPlayerNPC(i) || IsPlayerConnected(i))
            {
                SetPVarInt(i, "WeapSkill", 1);
                WeapSkill_Poor(i);
            }
        }
    }
    return 1;
}

You mean, like that?
Try to set PVars - theese are the best for this problems. They are resetting after disconnecting. Define 1 as poor, 2 as gangster, 3 as hitman - and integers in PVars, like in my solution. Next, in OnPlayerSpawn, use WeapSkill_Poor function when PVar "WeapSkill" is set to 1, WeapSkill_Gangster (after you create it) if PVar is set to 2 and so one. If you need to save it after disconnect, use mysql or file manipulation system.
  Reply


Messages In This Thread
[HELP] Weapon Skill Command - by spyrothedragon96 - 2021-08-03, 08:33 AM
RE: [HELP] Weapon Skill Command - by DjSon231 - 2021-08-03, 07:58 PM

Forum Jump: