Slots Weapons
#1

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;
}
Reply
#2

Bump
Reply
#3

Will check it out for u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)