Dropping one weapon
#1

I'm making a rent weapon system and I need to know how to drop a certain weapon instead of all of them.
Reply
#2

using
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData

basically what want to store the data, then give him back all the weapons except the one you dropped.
Reply
#3

I don't really understand that. Could you do it by getting the players weapon then making the ammo 0 after a set amount of time?
Reply
#4

Sup,

Try this:

pawn Код:
stock RemovePlayerWeapon(playerid, weaponid) {
    new Weapons[12], Ammo[12];
    for(new slot=0; slot !=12;++slot) {
        new weapon, ammo;
        GetPlayerWeaponData(playerid, slot, weapon, ammo);
        if(weapon !=weaponid && ammo !=0) {
            GetPlayerWeaponData(playerid, slot, Weapons[slot], Ammo[slot]);
        }
    }
    ResetPlayerWeapons(playerid);
    for(new slot =0; slot !=12;++slot) {
        if(Ammo[slot] != 0) {
        GivePlayerWeapon(playerid, Weapons[slot], Ammo[slot]);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)