Raised This Month: $51 Target: $400
 12% 

Change Weapon Size


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MasterXykon
BANNED
Join Date: Apr 2012
Plugin ID:
4164
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Change the size of weapons
    Old 04-13-2014 , 07:46   Change Weapon Size
    Reply With Quote #1

    Change Weapon Size





    Currently only tested in TF2


    Commands:
    sm_weaponsize in console / !weaponsize in chat
    sm_ws in console / !ws in chat

    CVars:
    sm_weaponsize_version

    Usage:
    sm_weaponsize <size #> - Changes your active weapon's size

    Known Issues:
    Doesn't work on weapons with moving parts / jigglebones

    Possible ToDo List:
    Add menu for easy access.
    Add a way for admins to force other players weapon sizes.
    Maybe fix weapons with jigglebones to work with this (if it's possible).
    Add a command for admins to reset weapon sizes.

    Attached Files
    File Type: sp Get Plugin or Get Source (weapon_size.sp - 2119 views - 1.1 KB)
    MasterXykon is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 04-13-2014 , 08:45   Re: Change Weapon Size
    Reply With Quote #2

    So far not bad, pretty short, hope to see more out of this! if you need any referencing then by all means go onto MstrOfXP's sandbox and check out his weapon resizer.

    Heres a few recommendations:
    i would change this:
    Code:
    	if(!IsClientConnected(client) || !IsClientInGame(client) || !IsPlayerAlive(client))
    	{
    		ReplyToCommand(client, "[WeaponSize] You must be alive");
    		return Plugin_Handled;
    	}
    to:
    Code:
    	if(!IsClientInGame(client))
    		return Plugin_Handled;
    	
    	if(!IsPlayerAlive(client))
    	{
    		ReplyToCommand(client, "[WeaponSize] You must be alive");
    		return Plugin_Handled;
    	}
    i also recommend adding in a feature so if a player inputs "sm_weaponsize" with no arg and he already has his weapon size set, then to default it back to normal.

    and huge problem here:
    Code:
    	new Float:fArg = StringToFloat(cmdArg);
    heres the reason: say a player enters: !ws LOL
    it would set his weapon size to 0.0
    when things are size 0.0, things seem to crash, especially if some one were to remove that weapon from the client's hand.
    something like this would help:
    Code:
    	if(fArg <= 0.0)
    	{
    		ReplyToCommand(client, "[WeaponSize] Weapon size must be greater than 0.0!");
    		return Plugin_Handled;
    	}
    or just set the fArg to default(1.0) or to the lowest anyone should go (0.1) which ever you choose would be fine.

    Code:
    		new String:cmdName[22];
    		GetCmdArg(0, cmdName, sizeof(cmdName));
    		ReplyToCommand(client, "[WeaponSize] Usage: %s #", cmdName);
    Why get the command name? I mean i know why, i guess this is just a personal preference.

    I would use decl for your strings since you are filling them right after any ways.
    Mitchell is offline
    MasterXykon
    BANNED
    Join Date: Apr 2012
    Old 04-13-2014 , 19:14   Re: Change Weapon Size
    Reply With Quote #3

    I just found out, that you can hold weapons up side down by entering a negative number.



    (example: sm_ws -1)
    MasterXykon is offline
    MasterXykon
    BANNED
    Join Date: Apr 2012
    Old 04-13-2014 , 20:42   Re: Change Weapon Size
    Reply With Quote #4

    If you want to see this mod for yourself, here's a test server IP:
    192.99.32.150:27015
    MasterXykon is offline
    vodka00
    Veteran Member
    Join Date: Jun 2012
    Location: Los Angeles
    Old 04-13-2014 , 21:00   Re: Change Weapon Size
    Reply With Quote #5

    Maybe add a threshold (scale) cvar to set the limits for how big players can make their weapons.
    __________________
    cw main:

    cw speedruns:
    vodka00 is offline
    Fearts
    ferts of daeth
    Join Date: Oct 2008
    Old 04-13-2014 , 21:33   Re: Change Weapon Size
    Reply With Quote #6

    This doesn't seem to work at all.
    __________________
    Fearts is offline
    vodka00
    Veteran Member
    Join Date: Jun 2012
    Location: Los Angeles
    Old 04-13-2014 , 22:22   Re: Change Weapon Size
    Reply With Quote #7

    Quote:
    Originally Posted by Fearts View Post
    This doesn't seem to work at all.
    Same here, tried on CS:S. Tried to reload the map, but haven't tried to restart the server.
    __________________
    cw main:

    cw speedruns:
    vodka00 is offline
    DJ Data
    SourceMod Donor
    Join Date: Dec 2012
    Location: Switzerland
    Old 04-15-2014 , 15:02   Re: Change Weapon Size
    Reply With Quote #8

    Quote:
    Originally Posted by MasterXykon View Post
    Add a way for admins to force other players weapon sizes.
    Yes please!
    __________________
    SourcePawn Coding Level: Novice

    Last edited by DJ Data; 04-15-2014 at 15:03.
    DJ Data is offline
    Sheepy
    Junior Member
    Join Date: Feb 2014
    Old 04-16-2014 , 10:11   Re: Change Weapon Size
    Reply With Quote #9

    maybe make a cfg file so admins can set, a flag on who can use the commands.
    Sheepy is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 04-16-2014 , 10:26   Re: Change Weapon Size
    Reply With Quote #10

    Quote:
    Originally Posted by Fearts View Post
    This doesn't seem to work at all.
    Just doesn't work at all? weird. And weird that it doesn't even show any error logs
    for those who said this isnt working try this:
    Attached Files
    File Type: sp Get Plugin or Get Source (weapon_size.sp - 1270 views - 1.9 KB)

    Last edited by Mitchell; 04-16-2014 at 10:55.
    Mitchell is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 12:04.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode