SA-MP Forums Archive
Slots Weapons - 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)
+--- Thread: Slots Weapons (/showthread.php?tid=498492)



Slots Weapons - SPA - 03.03.2014

Hello, iv a problem sometimes in server the weapons slots cant be access i mean when you have a gun you keep getting disarmed for no reason what the cause?

Here is code:
Код:
forward ResetMinigunEvent();
public ResetMinigunEvent()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(DMZone[i] < 1 && GodMode[i] == 0)
        {
        if(!IsPlayerConnected(i)) continue;
        RemovePlayerWeapon(i, 38);
        }
    }
    MinigunEvent = false;
    GameTextForAll("~N~~N~~N~~N~~r~~h~MINIGUN-EVENT ~R~ENDED",5000,5);
    return 1;
}
stock RemovePlayerWeapon(playerid, weaponid)
{
    new plyWeapons[12];
    new plyAmmo[12];

    for(new slot = 0; slot != 12; slot++)
    {
        new wep, ammo;
        GetPlayerWeaponData(playerid, slot, wep, ammo);

        if(wep != weaponid)
            GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
    }

    ResetPlayerWeapons(playerid);
    for(new slot = 0; slot != 12; slot++)
        GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
    return 1;
}



Re: Slots Weapons - SPA - 03.03.2014

Bump


Re: Slots Weapons - Walkingfire - 03.03.2014

Will check it out for u