Skills problem
#1

I have problem with function IsPlayerInAnyVehicle.I used it in public OnPlayerDeath for my Skills system.But Still have problem with that.I used negation for that function.Check code I don`t see any problem...
pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerWeapon(killerid) == 24) // deagle
        {
            SetPlayerSkillLevel(killerid,2,pInfo[killerid][pSkillDesert]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of Desert-Deagle is: %d / 1000 !",pInfo[killerid][pSkillDesert]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 31) // M4
        {
            SetPlayerSkillLevel(killerid,9,pInfo[killerid][pSkillM4]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of M4 is: %d / 1000 !",pInfo[killerid][pSkillM4]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 29) // MP5
        {
            SetPlayerSkillLevel(killerid,7,pInfo[killerid][pSkillMP5]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of MP5 is: %d / 1000 !",pInfo[killerid][pSkillMP5]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 26) // SWAN Off
        {
            SetPlayerSkillLevel(killerid,4,pInfo[killerid][pSkillSwan]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of Sawnoff Shotgun is: %d / 1000 !",pInfo[killerid][pSkillSwan]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 27) // Combat Shotgun
        {
            SetPlayerSkillLevel(killerid,5,pInfo[killerid][pSkillSpas]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of Combat Shotgun is: %d / 1000 !",pInfo[killerid][pSkillSpas]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 22) //Colt
        {
            SetPlayerSkillLevel(killerid,0,pInfo[killerid][pSkillPistol]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of 9mm is: %d / 1000 !",pInfo[killerid][pSkillPistol]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 25) //Shotgun
        {
            SetPlayerSkillLevel(killerid,3,pInfo[killerid][pSkillShotgun]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of Shotgun is: %d / 1000 !",pInfo[killerid][pSkillShotgun]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 34) //Sniper
        {
            SetPlayerSkillLevel(killerid,10,pInfo[killerid][pSkillSniper]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of Sniper Rifle is: %d / 1000 !",pInfo[killerid][pSkillSniper]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
        if(GetPlayerWeapon(killerid) == 30) //AK-47
        {
            SetPlayerSkillLevel(killerid,8,pInfo[killerid][pSkillAK47]+=1);
            format(slova,sizeof(slova),"{D4FF00}[Gun Skills] {FFFFFF}Your current skill level of AK-47 is: %d / 1000 !",pInfo[killerid][pSkillAK47]);
            SendClientMessage(killerid,0xFFFFFFFF,slova);
        }
    }
Reply
#2

The callback https://sampwiki.blast.hk/wiki/OnPlayerDeath already give out the reason that equals to the weapon id.. so you can get away getplayerweapon
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)