Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Possible better solution for weapon removal

  1. Default Possible better solution for weapon removal

    I am not looking into a better way of doing weapon removal per race. Rather than have all the same code repeated all over and using methods that I hope may reduce crashes I will instead try to use a 3rd party weapon restriction plugin on a player by player basis. This should actually reduce code in the races and allows us to use what should be the safest method of weapon removal by simply restricting the weapon in that plugin and then unresisting when needed.

    It is also possible that I may just fine the code in here and use that but I think that using this plugin could be useful b/c it could allow us to restrict without destroying things like bombs and kits for some races.



  2. Default

    Perhaps if I copy the natives from that program I can use them as an include to better remove weapons. I am posting idea code below for refrence later:

    restrict.inc
    Code:
    /**
     * Drops and removes clients weapon
     * 
     * @param    client        Client index
     * @param    weaponIndex    Weapon index to drop and remove
     * 
     * @error    Invalid client or weapon index.
     * @return     true if weapon was removed false otherwise
     */
    native bool:Restrict_RemoveWeaponDrop(client, weaponIndex);



  3. Default

    Holy shit I managed to dig up the source code:
    Code:
    CS_DropWeapon(client, entity, true, true);
        if(AcceptEntityInput(entity, "Kill"))
    This is the method used by the most popular weapon restrect mod to remove a weapon from a player and destory it. I will be converting all races to use this method as I update them in the future!



  4. Default

    This method is confirmed working I will be using this now as best use code.



  5. Default

    would this be implemented say towards the vagabond for kits?

  6. Default

    Quote Originally Posted by ZERO View Post
    Holy shit I managed to dig up the source code:
    Code:
    CS_DropWeapon(client, entity, true, true);
        if(AcceptEntityInput(entity, "Kill"))
    This is the method used by the most popular weapon restrect mod to remove a weapon from a player and destory it. I will be converting all races to use this method as I update them in the future!
    coupled with the above comment, would it mean that vagabonds destroy kits that they would otherwise pick up?

    Through the darkness of futures past,
    The magician longs to see
    One chants out between two worlds:
    Fire, walk with me.

  7. Default

    No I was thainking I could outsource the need for the code but that plugin does not support such a freautre.

    I was basically trying to do something else and then developed the technology to hopefully prevent the left hand glitch once and for all in the process. Or at the very least greatly minimize is more then before.



  8. Default

    gotten the left hand glitch 3 times as vaga today

    Through the darkness of futures past,
    The magician longs to see
    One chants out between two worlds:
    Fire, walk with me.

  9. Default

    When did you get the glitch? This is very strange, was it occuring at all prior to this change? I am using cssweapondrop which should be the safest possible way to remove it from the client.



  10. Default

    Quote Originally Posted by ZERO View Post
    When did you get the glitch? This is very strange, was it occuring at all prior to this change? I am using cssweapondrop which should be the safest possible way to remove it from the client.
    i don't remember it ever happening before the change, maybe once. one time i was just coming out of invis and my scout was left hand, once i was in invis and my knife left handed, then i was just in spawn at round start and my scout left handed.

    Through the darkness of futures past,
    The magician longs to see
    One chants out between two worlds:
    Fire, walk with me.

Posting Permissions

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