Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Make a weapon droppable after notdroppable?

  1. #11
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    I read a script somewhere that fixes the silent issue by editing the weapon's tik file
    ( found it it's Airbourne mod)

    the tik :


    fire garand_fire.skc
    {
    server
    {
    entry exec global/SPFIX_/soundfix.scr "m1" "fire"
    entry shoot
    }



    the scr file :


    _m1 local.s: // local.s = "fire"

    switch (local.s)
    {
    case "fire":
    self playsound m1_snd_fire
    break
    case "reload":
    self playsound m1_snd_reload
    waitframe
    self playsound snd_ping
    break
    }

    end
    //main thread not included , but it redirects to this one
    Last edited by RyBack; January 13th, 2015 at 01:03 PM.

  2. #12

    Default

    I've already tried doing that, but the problen is it will play twice the sound in dm/obj maps and if a player have high ping will be played with delay

  3. #13
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I think it's because you can shoot a weapon and drop it in the same time. Weapon gets detached from player hence there is no origin of sound - I didn't check it but it seems that sound of firing weapon gets it's origin from players position. When it's detached, game plays the sound from some distant location or something and it sound's like someone shot it from afterlife.

    I'm sure it could be fixed.

  4. #14
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,180

    Default

    Another concept, if they fire the weapon and drop at the same time, set damage to 0 so the player doesn't hurt enemy

    //If notDroppable is set
    if(notDroppable->integer)
    {


    //Does player have a active weapon
    if((player->activeWeapon != 0) || (ent->client->ps.activeItems[0] != -1))
    {
    weap = (Weapon_t *)player->activeWeapon;

    if(weap != NULL)
    {
    //Not sure, but this may be one way of detecting whether or not a weapon is being fired and dropped
    if(((weap->firemodeindex == "FIRE_PRIMARY" || weap->firemodeindex == "FIRE_SECONDARY") && (ucmd->buttons & BUTTON_GROUP_DROP_WEAPON)) || (ucmd->buttons & BUTTON_GROUP_FIRE_PRIMARY || ucmd->buttons & BUTTON_GROUP_FIRE_SECONDARY) && (ucmd->buttons & BUTTON_GROUP_DROP_WEAPON))
    {
    //If the above function passes it means that the player tried dropping the gun and shooting it at the same time.
    //Lets remove damage from him
    damage = 0;
    }
    }
    }
    }

  5. #15

    Default

    Within the game engine, modify the weapdrop function to conditionnally drop the current weapon if the current torso state is STAND.
    The only possibility would be to permanently prevent players from dropping weapons by setting the notdroppable flags of all weapons to true, otherwise it requires game engine modifications.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •