Try not complicated as possible, i just want when player type !head on first, server will execute sm_resizehead PLAYER 3. second execute of !head, server will execute sm_resizehead PLAYER 1. third execute of !head, server will execute sm_resizehead PLAYER 3.
Bonkorn, if you let everyone know how you solved the problem, it'd help others who may stumble upon the same issue.
Here's the source he edited out
Spoiler
PHP Code:
//////////////////////////////////////////////////////////// // // Fysics Control // (for TF2) // by thaCURSEDpie // // 2012-08-19 // // version 1.0.4 // // // This plugin aims to give server-admins // greater control over the game's physics. // ////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////// // // Includes et cetera // //////////////////////////////////////////////////////////// #pragma semicolon 1
#define PLUGIN_VERSION "1.0.4" #define SHORT_DESCRIPTION "Fysics Control Toggleable by thaCURSEDpie, Bonkorn" #define ADMINCMD_MIN_LEVEL ADMFLAG_SLAY
//////////////////////////////////////////////////////////// // // Global vars // //////////////////////////////////////////////////////////// //-- Constants static Float: Pi = 3.1415926535898;
//-- Handles new Handle: hEnabled = INVALID_HANDLE; new Handle: hAirstrafeMult = INVALID_HANDLE; new Handle: hBhopMult = INVALID_HANDLE; new Handle: hBhopMaxDelay = INVALID_HANDLE; new Handle: hBhopZMult = INVALID_HANDLE; new Handle: hBhopAngleRatio = INVALID_HANDLE; new Handle: hBhopLazyMode = INVALID_HANDLE; new Handle: hAllowBounce = INVALID_HANDLE; new Handle: hBounceMult = INVALID_HANDLE; new Handle: hBhopMaxSpeed = INVALID_HANDLE; new Handle: hBhopEnabled = INVALID_HANDLE; new Handle: hAirstrafeIgnoreScouts = INVALID_HANDLE;
//-- Values new Float: fAirstrafeMult = 1.0; new Float: fBhopMult = 1.0; new Float: fBhopMaxDelay = 0.2; new Float: fBhopZMult = 1.0; new Float: fBhopAngleRatio = 0.5; new bool: bAirstrafeIgnoreScouts = true; new bool: bModEnabled = true; new bool: bBhopLazyMode = false; new bool: bAllowBounce = false; new bool: bBhopEnabled = true; new Float: fBounceMult = 1.0; new Float: fBhopMaxSpeed = -1.0;
//-- Player properties new Float: fAirstrafeMults[MAXPLAYERS]; new Float: fBhopMults[MAXPLAYERS]; new Float: fBhopZMults[MAXPLAYERS]; new Float: fOldVels[MAXPLAYERS][3]; new Float: fBhopAngleRatios[MAXPLAYERS]; new bool: bIsInAir[MAXPLAYERS]; new bool: bJumpPressed[MAXPLAYERS]; new Float: fMomentTouchedGround[MAXPLAYERS]; new Float: fBhopMaxDelays[MAXPLAYERS]; new iBounceInfo[MAXPLAYERS]; new bool: bIsAllowedToBounce[MAXPLAYERS]; new bool: bBhopLazyModes[MAXPLAYERS]; new Float: fBounceMults[MAXPLAYERS]; new Float: fBhopMaxSpeeds[MAXPLAYERS]; new bool: bIsAllowedToBhop[MAXPLAYERS];
//////////////////////////////////////////////////////////// // // Mod description // //////////////////////////////////////////////////////////// public Plugin: myinfo = { name = "Fysics Control", author = "thaCURSEDpie, Bonkorn", description = "This plugin aims to give server admins more control over the game physics.", version = PLUGIN_VERSION, url = "http://www.sourcemod.net" };
//////////////////////////////////////////////////////////// // // OnPluginStart // //////////////////////////////////////////////////////////// public OnPluginStart() { LoadTranslations("common.phrases");
// Bhop RegAdminCmd("sm_bhop_mult", CmdBhopMult, ADMINCMD_MIN_LEVEL, "Change an individual users's horizontal bhop multiplier (-1 disables bhop)"); RegAdminCmd("sm_bhop_zmult", CmdBhopZMult, ADMINCMD_MIN_LEVEL, "Change an indivicual users's vertical bhop multiplier"); RegAdminCmd("sm_bhop_lazymode", CmdBhopLazyMode, ADMINCMD_MIN_LEVEL, "Allow/dissallow an individual user to bunnyhop by holding +jump"); RegAdminCmd("sm_bhop_enabled", CmdBhopEnabled, ADMINCMD_MIN_LEVEL, "Change whether or not an individual user can bunnyhop"); RegAdminCmd("sm_bhop", CmdBhopToggle, ADMFLAG_CUSTOM5, "Change whether or not an individual user can bunnyhop");
// Bounce RegAdminCmd("sm_bounce_mult", CmdBounceMult, ADMINCMD_MIN_LEVEL, "Change an individual users's bounce multiplier"); RegAdminCmd("sm_bounce_enabled", CmdBounceEnabled, ADMINCMD_MIN_LEVEL, "Allow/dissallow an individual user to bounce");
// Airstrafe hAirstrafeMult = CreateConVar("fc_airstrafe_mult", "1.0", "The multiplier to apply to airstrafing", _, true, 0.0, true, 1.0); hAirstrafeIgnoreScouts = CreateConVar("fc_airstrafe_ignorescouts", "1", "Sets the airstrafe multiplier to ignore scouts, since this tends to screw up double-jumps", _);
// Bhop hBhopEnabled = CreateConVar("fc_bhop_enabled", "1", "Whether or not players can bunnyhop", _); hBhopMult = CreateConVar("fc_bhop_mult", "1.0", "Horizontal boost to apply to bunnyhopping", _, true, 0.0); hBhopMaxDelay = CreateConVar("fc_bhop_maxdelay", "0.2", "Maximum time in seconds, after which the player has touched the ground and can still get a bhop boost.", _); hBhopZMult = CreateConVar("fc_bhop_zmult", "1.0", "Boost to apply to vertical velocity when bunnyhopping", _); hBhopAngleRatio = CreateConVar("fc_bhop_angleratio", "0.5", "Ratio between old and new velocity to be used with bunnyhopping", _, true, 0.0, true, 1.0); hBhopLazyMode = CreateConVar("fc_bhop_lazymode", "0", "Whether or not player can bunnyhop simply by holding +jump", _); hBhopMaxSpeed = CreateConVar("fc_bhop_maxspeed", "400", "The maximum speed for bunnyhopping. Use -1.0 for no max speed.", _, true, -1.0);
// Bounce hAllowBounce = CreateConVar("fc_bounce_enabled", "0", "Whether or not players can bounce", _); hBounceMult = CreateConVar("fc_bounce_mult", "1.0", "Modifies the strenght of a bounce", _, true, 0.0);
//---- Convar changed hooks // Overall mod HookConVarChange(hEnabled, OnEnabledChanged);
if (StringToIntEx(arg2, amount) == 0 || amount < 0) // This line will cause a tag mismatch warning. As bools are represented as either "1" or "0" in-game, there is nothing wrong with this method (as far as I know). { ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return; }
for (new i = 0; i < nTargets; i++) { targetArray[clients[i]] = amount; }
ReplyToCommand(client, "[FC] Successfully applied cmd %s with value %b to %s!", cmdName, amount, targetName); }
public HandleCmdMult(client, args, String: cmdName[], Float: targetArray[]) { if (args < 2) { new String: buf[300] = "[SM] Usage: "; StrCat(buf, sizeof(buf), cmdName); StrCat(buf, sizeof(buf), " <#userid|name> [amount]");
ReplyToCommand(client, buf);
return; }
decl clients[MAXPLAYERS]; new nTargets = 0;
decl String: targetName[MAX_TARGET_LENGTH];
if (GetTargetedClients(client, clients, nTargets, targetName) == 1) { return; }
for (new i = 0; i < nTargets; i++) { targetArray[clients[i]] = amount; }
ReplyToCommand(client, "[FC] Successfully applied cmd %s with value %f to %s!", cmdName, amount, targetName); }
// Gets the clients the admin wants to target // I got this somewhere from the SourceMod wiki, can't remember where :-( public GetTargetedClients(admin, clients[MAXPLAYERS], & targetCount, String: targetName[]) { decl String: arg[65]; GetCmdArg(1, arg, sizeof(arg));
// There are some strange instances we need to filter out, else the player sometimes gets propelled backwards if ((fOldAngle < 0) && (fNewAngle >= 0)) { fNewAngle = fAngle; } else if ((fNewAngle < 0) && (fOldAngle >= 0)) { fNewAngle = fAngle; }
if (bBhopLazyModes[client]) { fNewVel[2] = 300.0; }
// Find out if the player is on the ground or in the air new iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
if (iGroundEntity == -1) { // Air GetEntPropVector(client, Prop_Data, "m_vecVelocity", fOldVels[client]); bIsInAir[client] = true; } else { // Ground or entity if (bIsInAir[client]) { fMomentTouchedGround[client] = GetTickedTime(); bIsInAir[client] = false; } } }
///////////////////////////////////////////////////////// // // GetVectorAngle // // Notes: // Get the angle for the respective vector // ///////////////////////////////////////////////////////// Float: GetVectorAngle(Float: x, Float: y) { // set this to an arbitrary value, which we can use for error-checking new Float: theta = 1337.00;
Bonkorn, if you let everyone know how you solved the problem, it'd help others who may stumble upon the same issue.
Here's the source he edited out
Spoiler
PHP Code:
//////////////////////////////////////////////////////////// // // Fysics Control // (for TF2) // by thaCURSEDpie // // 2012-08-19 // // version 1.0.4 // // // This plugin aims to give server-admins // greater control over the game's physics. // ////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////// // // Includes et cetera // //////////////////////////////////////////////////////////// #pragma semicolon 1
#define PLUGIN_VERSION "1.0.4" #define SHORT_DESCRIPTION "Fysics Control Toggleable by thaCURSEDpie, Bonkorn" #define ADMINCMD_MIN_LEVEL ADMFLAG_SLAY
//////////////////////////////////////////////////////////// // // Global vars // //////////////////////////////////////////////////////////// //-- Constants static Float: Pi = 3.1415926535898;
//-- Handles new Handle: hEnabled = INVALID_HANDLE; new Handle: hAirstrafeMult = INVALID_HANDLE; new Handle: hBhopMult = INVALID_HANDLE; new Handle: hBhopMaxDelay = INVALID_HANDLE; new Handle: hBhopZMult = INVALID_HANDLE; new Handle: hBhopAngleRatio = INVALID_HANDLE; new Handle: hBhopLazyMode = INVALID_HANDLE; new Handle: hAllowBounce = INVALID_HANDLE; new Handle: hBounceMult = INVALID_HANDLE; new Handle: hBhopMaxSpeed = INVALID_HANDLE; new Handle: hBhopEnabled = INVALID_HANDLE; new Handle: hAirstrafeIgnoreScouts = INVALID_HANDLE;
//-- Values new Float: fAirstrafeMult = 1.0; new Float: fBhopMult = 1.0; new Float: fBhopMaxDelay = 0.2; new Float: fBhopZMult = 1.0; new Float: fBhopAngleRatio = 0.5; new bool: bAirstrafeIgnoreScouts = true; new bool: bModEnabled = true; new bool: bBhopLazyMode = false; new bool: bAllowBounce = false; new bool: bBhopEnabled = true; new Float: fBounceMult = 1.0; new Float: fBhopMaxSpeed = -1.0;
//-- Player properties new Float: fAirstrafeMults[MAXPLAYERS]; new Float: fBhopMults[MAXPLAYERS]; new Float: fBhopZMults[MAXPLAYERS]; new Float: fOldVels[MAXPLAYERS][3]; new Float: fBhopAngleRatios[MAXPLAYERS]; new bool: bIsInAir[MAXPLAYERS]; new bool: bJumpPressed[MAXPLAYERS]; new Float: fMomentTouchedGround[MAXPLAYERS]; new Float: fBhopMaxDelays[MAXPLAYERS]; new iBounceInfo[MAXPLAYERS]; new bool: bIsAllowedToBounce[MAXPLAYERS]; new bool: bBhopLazyModes[MAXPLAYERS]; new Float: fBounceMults[MAXPLAYERS]; new Float: fBhopMaxSpeeds[MAXPLAYERS]; new bool: bIsAllowedToBhop[MAXPLAYERS];
//////////////////////////////////////////////////////////// // // Mod description // //////////////////////////////////////////////////////////// public Plugin: myinfo = { name = "Fysics Control", author = "thaCURSEDpie, Bonkorn", description = "This plugin aims to give server admins more control over the game physics.", version = PLUGIN_VERSION, url = "http://www.sourcemod.net" };
//////////////////////////////////////////////////////////// // // OnPluginStart // //////////////////////////////////////////////////////////// public OnPluginStart() { LoadTranslations("common.phrases");
// Bhop RegAdminCmd("sm_bhop_mult", CmdBhopMult, ADMINCMD_MIN_LEVEL, "Change an individual users's horizontal bhop multiplier (-1 disables bhop)"); RegAdminCmd("sm_bhop_zmult", CmdBhopZMult, ADMINCMD_MIN_LEVEL, "Change an indivicual users's vertical bhop multiplier"); RegAdminCmd("sm_bhop_lazymode", CmdBhopLazyMode, ADMINCMD_MIN_LEVEL, "Allow/dissallow an individual user to bunnyhop by holding +jump"); RegAdminCmd("sm_bhop_enabled", CmdBhopEnabled, ADMINCMD_MIN_LEVEL, "Change whether or not an individual user can bunnyhop"); RegAdminCmd("sm_bhop", CmdBhopToggle, ADMFLAG_CUSTOM5, "Change whether or not an individual user can bunnyhop");
// Bounce RegAdminCmd("sm_bounce_mult", CmdBounceMult, ADMINCMD_MIN_LEVEL, "Change an individual users's bounce multiplier"); RegAdminCmd("sm_bounce_enabled", CmdBounceEnabled, ADMINCMD_MIN_LEVEL, "Allow/dissallow an individual user to bounce");
// Airstrafe hAirstrafeMult = CreateConVar("fc_airstrafe_mult", "1.0", "The multiplier to apply to airstrafing", _, true, 0.0, true, 1.0); hAirstrafeIgnoreScouts = CreateConVar("fc_airstrafe_ignorescouts", "1", "Sets the airstrafe multiplier to ignore scouts, since this tends to screw up double-jumps", _);
// Bhop hBhopEnabled = CreateConVar("fc_bhop_enabled", "1", "Whether or not players can bunnyhop", _); hBhopMult = CreateConVar("fc_bhop_mult", "1.0", "Horizontal boost to apply to bunnyhopping", _, true, 0.0); hBhopMaxDelay = CreateConVar("fc_bhop_maxdelay", "0.2", "Maximum time in seconds, after which the player has touched the ground and can still get a bhop boost.", _); hBhopZMult = CreateConVar("fc_bhop_zmult", "1.0", "Boost to apply to vertical velocity when bunnyhopping", _); hBhopAngleRatio = CreateConVar("fc_bhop_angleratio", "0.5", "Ratio between old and new velocity to be used with bunnyhopping", _, true, 0.0, true, 1.0); hBhopLazyMode = CreateConVar("fc_bhop_lazymode", "0", "Whether or not player can bunnyhop simply by holding +jump", _); hBhopMaxSpeed = CreateConVar("fc_bhop_maxspeed", "400", "The maximum speed for bunnyhopping. Use -1.0 for no max speed.", _, true, -1.0);
// Bounce hAllowBounce = CreateConVar("fc_bounce_enabled", "0", "Whether or not players can bounce", _); hBounceMult = CreateConVar("fc_bounce_mult", "1.0", "Modifies the strenght of a bounce", _, true, 0.0);
//---- Convar changed hooks // Overall mod HookConVarChange(hEnabled, OnEnabledChanged);
if (StringToIntEx(arg2, amount) == 0 || amount < 0) // This line will cause a tag mismatch warning. As bools are represented as either "1" or "0" in-game, there is nothing wrong with this method (as far as I know). { ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return; }
for (new i = 0; i < nTargets; i++) { targetArray[clients[i]] = amount; }
ReplyToCommand(client, "[FC] Successfully applied cmd %s with value %b to %s!", cmdName, amount, targetName); }
public HandleCmdMult(client, args, String: cmdName[], Float: targetArray[]) { if (args < 2) { new String: buf[300] = "[SM] Usage: "; StrCat(buf, sizeof(buf), cmdName); StrCat(buf, sizeof(buf), " <#userid|name> [amount]");
ReplyToCommand(client, buf);
return; }
decl clients[MAXPLAYERS]; new nTargets = 0;
decl String: targetName[MAX_TARGET_LENGTH];
if (GetTargetedClients(client, clients, nTargets, targetName) == 1) { return; }
for (new i = 0; i < nTargets; i++) { targetArray[clients[i]] = amount; }
ReplyToCommand(client, "[FC] Successfully applied cmd %s with value %f to %s!", cmdName, amount, targetName); }
// Gets the clients the admin wants to target // I got this somewhere from the SourceMod wiki, can't remember where :-( public GetTargetedClients(admin, clients[MAXPLAYERS], & targetCount, String: targetName[]) { decl String: arg[65]; GetCmdArg(1, arg, sizeof(arg));
// There are some strange instances we need to filter out, else the player sometimes gets propelled backwards if ((fOldAngle < 0) && (fNewAngle >= 0)) { fNewAngle = fAngle; } else if ((fNewAngle < 0) && (fOldAngle >= 0)) { fNewAngle = fAngle; }
if (bBhopLazyModes[client]) { fNewVel[2] = 300.0; }
// Find out if the player is on the ground or in the air new iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
if (iGroundEntity == -1) { // Air GetEntPropVector(client, Prop_Data, "m_vecVelocity", fOldVels[client]); bIsInAir[client] = true; } else { // Ground or entity if (bIsInAir[client]) { fMomentTouchedGround[client] = GetTickedTime(); bIsInAir[client] = false; } } }
///////////////////////////////////////////////////////// // // GetVectorAngle // // Notes: // Get the angle for the respective vector // ///////////////////////////////////////////////////////// Float: GetVectorAngle(Float: x, Float: y) { // set this to an arbitrary value, which we can use for error-checking new Float: theta = 1337.00;