Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Make a weapon droppable after notdroppable?

  1. #1

    Default Make a weapon droppable after notdroppable?

    Hello!

    I'm trying to make an "anti-silentshot" mod but i have this problem

    from models/weapons/springfield.tik

    fire springfield.skc
    {
    server
    {
    entry exec global/antisilent.scr
    entry shoot
    }
    //Etc...


    and global/antisilent.scr is:


    main:
    self notdroppable;
    waitframe;
    //self droppable;
    end;


    It works to prevent the silentshot, but something like a droppable function for weapons would be perfect.
    is possible to emulate this function?

    Regards!

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

    Default

    I don't understand... What would the droppable function do that isn't already available in the game? You can already drop any weapon and item in the game...

  3. #3

    Default

    yeah right unless he wants to be able to turn it on or off with a cvar? own 3m all mod does that, heck most weapons mods do that

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

    Default

    If own3mall's mod does that, why not just use that?

    if your thing above works then just do something like this..

    Code:
    setcvar isDroppable = 1;
    
    
    if(isDroppable.integer || isDroppable > 0)
    {
        //No need to do anything because the default option for all weapons is that they are droppable
        //Unless you want it to do something else, then add your code below
    }
    else
    {
        self notdroppable;
    }
    This isn't copy & paste code, simply the syntax and logic behind what you're trying to achieve. It should work in game.

  5. #5

    Default

    Quote Originally Posted by James View Post
    I don't understand... What would the droppable function do that isn't already available in the game? You can already drop any weapon and item in the game...
    I know, but after make a weapon notdroppable you can't drop anymore until you respawn and get a new weapon.
    I want to get a weapon nontdroppable just for a little time when you shot, only to prevent the silentshots.

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

    Default

    Updated

    level waittill spawn
    main:

    setcvar "isDroppable" "1"

    while(1)
    {
    for(local.i=1;local.i<=$player.size;local.i++)
    {
    // this makes sure we will be referencing the same
    // player during our check, which now
    // covers multiple server frames
    local.p = $player[local.i]

    if( local.p.fireheld )
    {
    self notdroppable;
    }
    else
    {
    self droppable;
    }
    }
    waitframe
    }
    end

  7. #7

    Default

    it will not work because droppable function doesn't exist in mohaa.
    i'm looking for a way to make a weapon droppable after making it notdroppable, but i think is currently impossible.

    thanks anyway.

  8. #8

    Default

    I think you're correct. droppable is not a valid command.

    The way the ubermod works is that it switches through the weapon model, then it checks for a cvar, and then it sets the weapon settings appropriately based on the cvar. If you change the cvar, the new setting (where the weapon is droppable) will not apply until the player has respawned.

    You could always spawn ammo packs:

    http://www.x-null.net/forums/showthr...-Not-Droppable
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


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

    Default

    I think Silent Shots could be prevented by fixing state files. Weapon should be only droppable if player is in specific state. You shouldn't be able to drop weapon when you fire it.

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

    Default

    Not sure if this will work, but...

    Entity_t *e = ent->entity;
    Sentient *s = (Sentient *)e;
    Player *p = (Player *)e;
    Weapon_t *weapon = NULL, *weap = NULL;


    //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
    if(weap->firemodeindex == "FIRE_PRIMARY" || weap->firemodeindex == "FIRE_SECONDARY")
    {
    //Don't drop weapon
    weap->notdroppable == TRUE;
    }


    //A second way of checking if a weapon is being fired
    if(ucmd->buttons & BUTTON_GROUP_FIRE_PRIMARY || ucmd->buttons & BUTTON_GROUP_FIRE_SECONDARY)
    {
    //Don't drop weapon
    weap->notdroppable == TRUE;
    }
    }
    }


    or maybe this


    //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))
    {
    //Force sound
    gameImport.Sound(&gEntTo->s.origin, gEntFrom->client->ps.clientNum, 2, "sound/weapons/fire/Colt45Fire1.wav", 1.0, 10.0, 1.0, 500.0, qfalse);
    }


    //A second way of checking if a weapon is being fired and dropped
    if((ucmd->buttons & BUTTON_GROUP_FIRE_PRIMARY || ucmd->buttons & BUTTON_GROUP_FIRE_SECONDARY) && (ucmd->buttons & BUTTON_GROUP_DROP_WEAPON))
    {
    //Force sound
    gameImport.Sound(&gEntTo->s.origin, gEntFrom->client->ps.clientNum, 2, "sound/weapons/fire/Colt45Fire1.wav", 1.0, 10.0, 1.0, 500.0, qfalse);
    }
    }
    }

Posting Permissions

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