ConstructionBoy
03-12-2016, 14:25
Hey guys, this is my first post but definately not my last. I downloaded this plugin (https://forums.alliedmods.net/showthread.php?p=2123938) and I want to edit it so that you can change your weapon size no greater than size 3 and no smaller than 0.5. This is what I did to it and all it does is say "Maximum weapon size is 3" even if I put the value at 1 or 2.
#include <sourcemod>
#include <sdktools>
#define VERSION "1.0"
public Plugin:myinfo =
{
name = "Change Weapon Size",
author = "Master Xykon",
description = "Change the size of weapons.",
version = VERSION,
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_weaponsize_version", VERSION, "Change the Size of Weapons", FCVAR_REPLICATED|FCVAR_NOTIFY);
RegConsoleCmd("sm_weaponsize", WeaponSize);
RegConsoleCmd("sm_ws", WeaponSize);
}
public Action:WeaponSize(client, args)
{
if(!IsClientConnected(client) || !IsClientInGame(client) || !IsPlayerAlive(client))
{
ReplyToCommand(client, "You must be alive to change your weapon size");
return Plugin_Handled;
}
if (args < 3)
{
ReplyToCommand(client, "Maximum weapon size is 3");
return Plugin_Handled;
}
if (args > 0.5)
{
ReplyToCommand(client, "Minimum weapon size is 0.5");
return Plugin_Handled;
}
new ClientWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
new String:cmdArg[22];
GetCmdArg(1, cmdArg, sizeof(cmdArg));
new Float:fArg = StringToFloat(cmdArg);
SetEntPropFloat(ClientWeapon, Prop_Send, "m_flModelScale", fArg);
return Plugin_Handled;
}
#include <sourcemod>
#include <sdktools>
#define VERSION "1.0"
public Plugin:myinfo =
{
name = "Change Weapon Size",
author = "Master Xykon",
description = "Change the size of weapons.",
version = VERSION,
url = ""
};
public OnPluginStart()
{
CreateConVar("sm_weaponsize_version", VERSION, "Change the Size of Weapons", FCVAR_REPLICATED|FCVAR_NOTIFY);
RegConsoleCmd("sm_weaponsize", WeaponSize);
RegConsoleCmd("sm_ws", WeaponSize);
}
public Action:WeaponSize(client, args)
{
if(!IsClientConnected(client) || !IsClientInGame(client) || !IsPlayerAlive(client))
{
ReplyToCommand(client, "You must be alive to change your weapon size");
return Plugin_Handled;
}
if (args < 3)
{
ReplyToCommand(client, "Maximum weapon size is 3");
return Plugin_Handled;
}
if (args > 0.5)
{
ReplyToCommand(client, "Minimum weapon size is 0.5");
return Plugin_Handled;
}
new ClientWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
new String:cmdArg[22];
GetCmdArg(1, cmdArg, sizeof(cmdArg));
new Float:fArg = StringToFloat(cmdArg);
SetEntPropFloat(ClientWeapon, Prop_Send, "m_flModelScale", fArg);
return Plugin_Handled;
}