SA-MP Forums Archive
Reset weapon slot - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Reset weapon slot (/showthread.php?tid=273836)



Reset weapon slot - FireCat - 03.08.2011

Is there any way i can reset some players weapons slot, without reseting his whole weapons?
Like i want to remove his sawns, if he has some, but still keep the deagle, if he has any.
Get what im trying to say?


Re: Reset weapon slot - Snipa - 03.08.2011

GetPlayerWeaponData for every slot except for the shotgun, and store it into vars. ResetPlayerWeapons, then give the weapons from the vars.


Re: Reset weapon slot - Calgon - 03.08.2011

pawn Code:
stock RemoveWeaponFromSlot(playerid, iWeaponSlot) {
    new weapons[13][2];
    for(new i = 0; i < 13; i++)
        GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);

    weapons[iWeaponSlot][0] = 0;

    ResetPlayerWeapons(playerid);
   
    for(new i = 0; i < 13; i++)
        GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
       
    return 1;
}